Handle null audio data
This commit is contained in:
@@ -71,6 +71,9 @@ class AudioBuffer {
|
||||
#if (cpp || neko)
|
||||
|
||||
var data = lime_audio_load (path);
|
||||
|
||||
if (data != null) {
|
||||
|
||||
var audioBuffer = new AudioBuffer ();
|
||||
audioBuffer.bitsPerSample = data.bitsPerSample;
|
||||
audioBuffer.channels = data.channels;
|
||||
@@ -78,12 +81,12 @@ class AudioBuffer {
|
||||
audioBuffer.sampleRate = data.sampleRate;
|
||||
return audioBuffer;
|
||||
|
||||
#else
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
#end
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user