Skip to content

Commit

Permalink
Map OggAudioStream and some related stuff (#639)
Browse files Browse the repository at this point in the history
* Map OggAudioStream and some related stuff

* Fix "MAX_SAMPLES" meaning
  • Loading branch information
Redfan2 authored Sep 17, 2024
1 parent 5f95852 commit 3372129
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CLASS net/minecraft/unmapped/C_sotxsrbb net/minecraft/client/sound/BufferedAudioStream
FIELD f_iciccron EXPECTED_MAX_FRAME_SIZE I
METHOD m_oxmnkscz readFrame (Lit/unimi/dsi/fastutil/floats/FloatConsumer;)Z
ARG 1 output
11 changes: 11 additions & 0 deletions mappings/net/minecraft/client/sound/ChannelList.mapping
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CLASS net/minecraft/unmapped/C_hwtbkxpz net/minecraft/client/sound/ChannelList
FIELD f_bfvadbcu currentBufferSize I
FIELD f_bztfudnt buffers Ljava/util/List;
FIELD f_nadhdvvb buffer Ljava/nio/ByteBuffer;
FIELD f_yoooifrn size I
METHOD <init> (I)V
ARG 1 bufferSize
METHOD accept addChannel (F)V
ARG 1 data
METHOD m_tbwtswjb getBuffer ()Ljava/nio/ByteBuffer;
METHOD m_vcsjohlh getCurrentBufferSize ()I
2 changes: 2 additions & 0 deletions mappings/net/minecraft/client/sound/FiniteAudioStream.mapping
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CLASS net/minecraft/unmapped/C_sxqhbpzn net/minecraft/client/sound/FiniteAudioStream
METHOD m_lmmmaoqk getBuffer ()Ljava/nio/ByteBuffer;
43 changes: 43 additions & 0 deletions mappings/net/minecraft/client/sound/OggAudioStream.mapping
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
CLASS net/minecraft/unmapped/C_osybdcpo net/minecraft/client/sound/OggAudioStream
FIELD f_bnzdhjzq EXPECTED_MAX_FRAME_SIZE I
FIELD f_ctqdwixq totalSamplesInStream J
FIELD f_dgqtinlj state Lcom/jcraft/jogg/StreamState;
FIELD f_djhpehah soundProcessor Lcom/jcraft/jorbis/DspState;
FIELD f_ejavwrtw inputStream Ljava/io/InputStream;
FIELD f_euzzfoxr samplesWritten J
FIELD f_mdavmxfj syncState Lcom/jcraft/jogg/SyncState;
FIELD f_pilmrhpz frame Lcom/jcraft/jogg/Page;
FIELD f_qlbmiuko rawAudioFrame Lcom/jcraft/jogg/Packet;
FIELD f_qtbdzokq processedAudioFrame Lcom/jcraft/jorbis/Block;
FIELD f_vzbyyvhw format Ljavax/sound/sampled/AudioFormat;
FIELD f_wahodjuq properties Lcom/jcraft/jorbis/Info;
METHOD <init> (Ljava/io/InputStream;)V
ARG 1 inputStream
METHOD close close ()V
METHOD m_asdsaorv readAllChannels ([[FI[IJLit/unimi/dsi/fastutil/floats/FloatConsumer;)V
ARG 0 channelBuffers
ARG 1 channelCount
ARG 2 startIndexes
ARG 3 samplesToWrite
ARG 5 output
METHOD m_bimljqtb readPage ()Lcom/jcraft/jogg/Page;
METHOD m_bywsuebv getSampleToWrite (I)J
ARG 1 samples
METHOD m_bzwaelxt getRawAudio ()Lcom/jcraft/jogg/Packet;
METHOD m_eeeoajbz readMono ([FIJLit/unimi/dsi/fastutil/floats/FloatConsumer;)V
ARG 0 buf
ARG 1 startIndex
ARG 2 samplesToWrite
ARG 4 output
METHOD m_izjvnksj readStereo ([FI[FIJLit/unimi/dsi/fastutil/floats/FloatConsumer;)V
ARG 0 leftBuf
ARG 1 leftStartIndex
ARG 2 rightBuf
ARG 3 rightStartIndex
ARG 4 samplesToWrite
ARG 6 output
METHOD m_nceiwgbq isInvalid (I)Z
ARG 0 state
METHOD m_sszxrscr isFinished ()Z
METHOD m_vdfmjcwj getPacket (Lcom/jcraft/jogg/Page;)Lcom/jcraft/jogg/Packet;
ARG 1 page

1 comment on commit 3372129

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With commit 3372129, 1 file(s) were updated with 3 line(s) added and 5 removed compared to the latest Quilt Mappings version.

View the diff here:
Only in namedSrc/net/minecraft/client/sound: BufferedAudioStream.java
Only in namedSrc/net/minecraft/client/sound: ChannelList.java
Only in namedSrc/net/minecraft/client/sound: FiniteAudioStream.java
Only in namedSrc/net/minecraft/client/sound: OggAudioStream.java
diff -bur namedTargetSrc/net/minecraft/client/sound/SoundLoader.java namedSrc/net/minecraft/client/sound/SoundLoader.java
--- namedTargetSrc/net/minecraft/client/sound/SoundLoader.java	2024-09-17 02:58:46.437788954 +0000
+++ namedSrc/net/minecraft/client/sound/SoundLoader.java	2024-09-17 02:57:30.742067197 +0000
@@ -11,8 +11,6 @@
 import net.fabricmc.api.EnvType;
 import net.fabricmc.api.Environment;
 import net.minecraft.resource.ResourceFactory;
-import net.minecraft.unmapped.C_osybdcpo;
-import net.minecraft.unmapped.C_sxqhbpzn;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.Util;
 
@@ -52,10 +50,10 @@
 
                StaticSound var5;
                try {
-                  C_sxqhbpzn lv = new C_osybdcpo(inputStream);
+                  FiniteAudioStream lv = new OggAudioStream(inputStream);
 
                   try {
-                     ByteBuffer byteBuffer = lv.m_lmmmaoqk();
+                     ByteBuffer byteBuffer = lv.getBuffer();
                      var5 = new StaticSound(byteBuffer, lv.getFormat());
                   } catch (Throwable var8) {
                      try {
@@ -99,7 +97,7 @@
       return CompletableFuture.supplyAsync(() -> {
          try {
             InputStream inputStream = this.resourceManager.open(id);
-            return (AudioStream)(repeatInstantly ? new RepeatingAudioStream(C_osybdcpo::new, inputStream) : new C_osybdcpo(inputStream));
+            return (AudioStream)(repeatInstantly ? new RepeatingAudioStream(OggAudioStream::new, inputStream) : new OggAudioStream(inputStream));
          } catch (IOException var4) {
             throw new CompletionException(var4);
          }
Only in namedTargetSrc/net/minecraft/unmapped: C_hwtbkxpz.java
Only in namedTargetSrc/net/minecraft/unmapped: C_osybdcpo.java
Only in namedTargetSrc/net/minecraft/unmapped: C_sotxsrbb.java
Only in namedTargetSrc/net/minecraft/unmapped: C_sxqhbpzn.java

Please sign in to comment.