We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 481b89e commit b069131Copy full SHA for b069131
src/engine/audio/Sample.cpp
@@ -44,8 +44,22 @@ namespace Audio {
44
audioLogs.Debug("Deleting Sample '%s'", GetName());
45
}
46
47
+ static AudioData GenerateNullSample() {
48
+ // 8KHz 16bit mono.
49
+ AudioData out { 8000, 2, 1 };
50
+ // 1 sample, silence.
51
+ out.rawSamples.resize( 2 );
52
+ return out;
53
+ }
54
+
55
bool Sample::Load() {
56
audioLogs.Debug("Loading Sample '%s'", GetName());
57
58
+ if ( GetName() == "sound/null" || GetName() == "sound/null.wav" ) {
59
+ buffer.Feed( GenerateNullSample() );
60
+ return true;
61
62
63
AudioData audioData = LoadSoundCodec(GetName());
64
65
if ( !audioData.rawSamples.size() ) {
0 commit comments