私はAndroidでこの問題に直面しましたが、解決しました!しかし、IOSでは機能せず、1日以上かけて解決しようとしました。フォルダ内のすべてをトレースしたところ、パスが正しく表示されましたが、サウンドパスを呼び出してロードすると、このメッセージが表示され続けます。
これはトレースの結果です
/var/mobile/Applications/A121170F-40A0-4FF8-B93B-238D2B09C797/Documents/story1/zipFolder/mp3/1.mp3
1.mp3
/var/mobile/Applications/A121170F-40A0-4FF8-B93B-238D2B09C797/Documents/story1/zipFolder/mp3/2.mp3
2.mp3
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at buildPageAnimation::LoadAndSetAnimation/loadComplete()[D:\TestUnZipFile\Ipad-new methods for animations - unzip\src\buildPageAnimation\LoadAndSetAnimation.as:95]
at buildPageAnimation::LoadAndSetAnimation/loadComplete()
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at buildPageAnimation::LoadAndSetAnimation/loadComplete()[D:\TestUnZipFile\Ipad-new methods for animations - unzip\src\buildPageAnimation\LoadAndSetAnimation.as:95]
at buildPageAnimation::LoadAndSetAnimation/loadComplete()
これがコードです
var soundFile:File = File.documentsDirectory.resolvePath('story1/zipFolder/mp3/');
var files:Array = soundFile.getDirectoryListing();
for (var i:uint = 0; i < files.length; i++)
{
trace(files[i].nativePath);// gets the path of the files
trace(files[i].name);// gets the name
var mySound:Sound = new Sound();
var myChannel:SoundChannel = new SoundChannel();
var lastPosition:Number = 0;
mySound.load(new URLRequest(files[0].nativePath));
myChannel = mySound.play();
}
私はこのfile:/// C:/Users/MASTER/Documents/story1/zipFolder/mp3/1.mp3のような静的パスを試しましたが、機能しません。誰かがこれを手伝ってくれる人がいます。