@@ -475,6 +475,12 @@ interface class SoLoud {
475
475
final completeFileName = result['completeFileName' ] as String ;
476
476
final hash = result['hash' ] as int ;
477
477
478
+ if (hash == 0 ) {
479
+ loadedFileCompleters[result['completeFileName' ]]
480
+ ? .completeError (SoLoudCppException .fromPlayerError (error));
481
+ return ;
482
+ }
483
+
478
484
final newSound = AudioSource (SoundHash (hash));
479
485
final alreadyLoaded = _activeSounds
480
486
.where ((sound) => sound.soundHash == newSound.soundHash)
@@ -496,6 +502,8 @@ interface class SoLoud {
496
502
_activeSounds.add (newSound);
497
503
}
498
504
} else {
505
+ loadedFileCompleters[result['completeFileName' ]]
506
+ ? .completeError (SoLoudCppException .fromPlayerError (error));
499
507
throw SoLoudCppException .fromPlayerError (error);
500
508
}
501
509
loadedFileCompleters[result['completeFileName' ]]? .complete (newSound);
@@ -535,6 +543,7 @@ interface class SoLoud {
535
543
/// Returns the new sound as [AudioSource] .
536
544
///
537
545
/// Throws [SoLoudNotInitializedException] if the engine is not initialized.
546
+ /// Throws [SoLoudFileLoadFailedException] if the file could not be loaded.
538
547
///
539
548
/// If the file is already loaded, this is a no-op (but a warning
540
549
/// will be produced in the log).
@@ -631,6 +640,7 @@ interface class SoLoud {
631
640
/// Throws a [SoLoudTemporaryFolderFailedException] if there was a problem
632
641
/// creating the temporary file that the asset will be copied to.
633
642
/// Throws [SoLoudNotInitializedException] if the engine is not initialized.
643
+ /// Throws [SoLoudFileLoadFailedException] if the file could not be loaded.
634
644
///
635
645
/// Returns the new sound as [AudioSource] .
636
646
///
@@ -673,6 +683,7 @@ interface class SoLoud {
673
683
/// Throws a [SoLoudTemporaryFolderFailedException] if there was a problem
674
684
/// creating the temporary file that the asset will be copied to.
675
685
/// Throws [SoLoudNotInitializedException] if the engine is not initialized.
686
+ /// Throws [SoLoudFileLoadFailedException] if the file could not be loaded.
676
687
///
677
688
/// Returns the new sound as [AudioSource] .
678
689
///
0 commit comments