簡體   English   中英

錯誤#2044:未處理的IOErrorEvent :。 text =錯誤#2032:流錯誤

[英]Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error

我在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();
    }

我試圖但是靜態路徑像這樣的文件:/// C:/Users/MASTER/Documents/story1/zipFolder/mp3/1.mp3,它不起作用。請有人幫我解決這個問題。

我也想非常感謝。

我正在使用.nativePath而不是.url來提供給URLRequest。 在模擬器(Windows)上,無論哪種方法都可以正常工作,但是我在iOS上遇到此流錯誤。 考慮到我需要大約15分鍾的時間來進行遠程調試,因此答案如此簡單,我感到非常放心。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM