@@ -75,13 +75,11 @@ SoundStreamHandleClass::Initialize (SoundBufferClass *buffer)
7575 if (Buffer != NULL ) {
7676
7777 //
78- // Create a stream from the sample handle
78+ // Create a stream
7979 //
80- StreamHandle = ::AIL_open_stream_by_sample (WWAudioClass::Get_Instance ()->Get_2D_Driver (),
81- SampleHandle, buffer->Get_Filename (), 0 );
82-
83- /* StreamHandle = ::AIL_open_stream (WWAudioClass::Get_Instance ()->Get_2D_Driver (),
84- buffer->Get_Filename (), 0);*/
80+ // TheSuperHackers @fix xezon 05/04/2025 Upgrades miles call from legacy AIL_open_stream_by_sample.
81+ StreamHandle = ::AIL_open_stream (WWAudioClass::Get_Instance ()->Get_2D_Driver (),
82+ buffer->Get_Filename (), 0 );
8583 }
8684
8785 return ;
@@ -163,7 +161,12 @@ void
163161SoundStreamHandleClass::Set_Sample_Pan (S32 pan)
164162{
165163 if (StreamHandle != (HSTREAM)INVALID_MILES_HANDLE) {
166- ::AIL_set_stream_pan (StreamHandle, pan);
164+ // TheSuperHackers @fix xezon 05/04/2025 Upgrades miles call from legacy AIL_set_stream_pan.
165+ // TheSuperHackers @todo Perhaps use float natively.
166+ float fVolume = 0 .0F ;
167+ ::AIL_stream_volume_pan (StreamHandle, &fVolume , NULL );
168+ float fPan = pan / 127 .0F ;
169+ ::AIL_set_stream_volume_pan (StreamHandle, fVolume , fPan );
167170 }
168171 return ;
169172}
@@ -180,7 +183,10 @@ SoundStreamHandleClass::Get_Sample_Pan (void)
180183 S32 retval = 0 ;
181184
182185 if (StreamHandle != (HSTREAM)INVALID_MILES_HANDLE) {
183- retval = ::AIL_stream_pan (StreamHandle);
186+ // TheSuperHackers @fix xezon 05/04/2025 Upgrades miles call from legacy AIL_stream_pan.
187+ float fPan = 0 .5F ;
188+ ::AIL_stream_volume_pan (StreamHandle, NULL , &fPan );
189+ retval = fPan * 127 ;
184190 }
185191
186192 return retval;
@@ -196,7 +202,12 @@ void
196202SoundStreamHandleClass::Set_Sample_Volume (S32 volume)
197203{
198204 if (StreamHandle != (HSTREAM)INVALID_MILES_HANDLE) {
199- ::AIL_set_stream_volume (StreamHandle, volume);
205+ // TheSuperHackers @fix xezon 05/04/2025 Upgrades miles call from legacy AIL_set_stream_volume.
206+ // TheSuperHackers @todo Perhaps use float natively.
207+ float fPan = 0 .5F ;
208+ ::AIL_stream_volume_pan (StreamHandle, NULL , &fPan );
209+ float fVolume = volume / 127 .0F ;
210+ ::AIL_set_stream_volume_pan (StreamHandle, fVolume , fPan );
200211 }
201212 return ;
202213}
@@ -213,7 +224,10 @@ SoundStreamHandleClass::Get_Sample_Volume (void)
213224 S32 retval = 0 ;
214225
215226 if (StreamHandle != (HSTREAM)INVALID_MILES_HANDLE) {
216- retval = ::AIL_stream_volume (StreamHandle);
227+ // TheSuperHackers @fix xezon 05/04/2025 Upgrades miles call from legacy AIL_stream_volume.
228+ float fVolume = 0 .0F ;
229+ ::AIL_stream_volume_pan (StreamHandle, &fVolume , NULL );
230+ retval = fVolume * 127 ;
217231 }
218232
219233 return retval;
0 commit comments