refactor: Update audio logging for clarity and consistency
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
import 'package:wolf_3d_dart/src/synth/imf_renderer.dart';
|
||||
import 'package:wolf_3d_dart/wolf_3d_data_types.dart';
|
||||
import 'package:wolf_3d_dart/wolf_3d_engine.dart';
|
||||
import 'package:wolf_3d_dart/src/synth/imf_renderer.dart';
|
||||
|
||||
class WolfAudio implements EngineAudio {
|
||||
@override
|
||||
@@ -11,7 +11,7 @@ class WolfAudio implements EngineAudio {
|
||||
// Play the first 50 sounds with a 2-second gap to identify them
|
||||
for (int i = 0; i < 50; i++) {
|
||||
Future.delayed(Duration(seconds: i * 2), () {
|
||||
print("Testing Sound ID: $i");
|
||||
print("[AUDIO] Testing Sound ID: $i");
|
||||
playSoundEffect(i);
|
||||
});
|
||||
}
|
||||
@@ -51,10 +51,10 @@ class WolfAudio implements EngineAudio {
|
||||
|
||||
_isInitialized = true;
|
||||
print(
|
||||
"WolfAudio: AudioPlayers initialized successfully with $_maxSfxChannels SFX channels.",
|
||||
"[AUDIO] AudioPlayers initialized successfully with $_maxSfxChannels SFX channels.",
|
||||
);
|
||||
} catch (e) {
|
||||
print("WolfAudio: Failed to initialize AudioPlayers - $e");
|
||||
print("[AUDIO] Failed to initialize AudioPlayers - $e");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ class WolfAudio implements EngineAudio {
|
||||
);
|
||||
await _musicPlayer.play(BytesSource(wavBytes));
|
||||
} catch (e) {
|
||||
print("WolfAudio: Error playing music track - $e");
|
||||
print("[AUDIO] Error playing music track - $e");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ class WolfAudio implements EngineAudio {
|
||||
if (index < data.music.length) {
|
||||
await playMusic(data.music[index]);
|
||||
} else {
|
||||
print("WolfAudio: Warning - Track index $index out of bounds.");
|
||||
print("[AUDIO] Warning - Track index $index out of bounds.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ class WolfAudio implements EngineAudio {
|
||||
|
||||
@override
|
||||
Future<void> playSoundEffect(int sfxId) async {
|
||||
print("Playing sfx id $sfxId");
|
||||
print("[AUDIO] Playing sfx id $sfxId");
|
||||
// The original engine uses a specific starting chunk for digitized sounds.
|
||||
// In many loaders, the 'sounds' list is already just the digitized ones.
|
||||
// If your list contains EVERYTHING, you need to add the offset (174).
|
||||
@@ -168,7 +168,7 @@ class WolfAudio implements EngineAudio {
|
||||
// Note: We use BytesSource because createWavFile returns Uint8List (the file bytes)
|
||||
await player.play(BytesSource(wavBytes));
|
||||
} catch (e) {
|
||||
print("WolfAudio: SFX Error - $e");
|
||||
print("[AUDIO] SFX Error - $e");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user