@@ -75,13 +75,11 @@ SoundStreamHandleClass::Initialize (SoundBufferClass *buffer)
75
75
if (Buffer != NULL ) {
76
76
77
77
//
78
- // Create a stream from the sample handle
78
+ // Create a stream
79
79
//
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 );
85
83
}
86
84
87
85
return ;
@@ -163,7 +161,12 @@ void
163
161
SoundStreamHandleClass::Set_Sample_Pan (S32 pan)
164
162
{
165
163
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 );
167
170
}
168
171
return ;
169
172
}
@@ -180,7 +183,10 @@ SoundStreamHandleClass::Get_Sample_Pan (void)
180
183
S32 retval = 0 ;
181
184
182
185
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 ;
184
190
}
185
191
186
192
return retval;
@@ -196,7 +202,12 @@ void
196
202
SoundStreamHandleClass::Set_Sample_Volume (S32 volume)
197
203
{
198
204
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 );
200
211
}
201
212
return ;
202
213
}
@@ -213,7 +224,10 @@ SoundStreamHandleClass::Get_Sample_Volume (void)
213
224
S32 retval = 0 ;
214
225
215
226
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 ;
217
231
}
218
232
219
233
return retval;
0 commit comments