You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Joe Bowser (JIRA)" <ji...@apache.org> on 2012/07/30 23:07:34 UTC

[jira] [Resolved] (CB-1158) Local Audio Failed to Play after an upgrade from 1.9.0 to 2.0.0 on PhoneGap

     [ https://issues.apache.org/jira/browse/CB-1158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser resolved CB-1158.
----------------------------

    Resolution: Cannot Reproduce

Local files work fine with mobile spec using /android_asset/www/ + local_path_to_file
                
> Local Audio Failed to Play after an upgrade from 1.9.0 to 2.0.0 on PhoneGap
> ---------------------------------------------------------------------------
>
>                 Key: CB-1158
>                 URL: https://issues.apache.org/jira/browse/CB-1158
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.0.0
>         Environment: PhoneGap 2.0.0. built project with API level 16, minimum API level 8. It was tested on an Android emulator at API level 10. 
>            Reporter: Caleb Qian
>            Assignee: Joe Bowser
>            Priority: Critical
>
> A local audio file that was named "temp.mp3" cannot be played after the upgrade from version 1.9.0 to 2.0.0. My Phone Gap app was able to play this file upon the version of 1.9.0. 
> The audio file was located at "/android_asset/www/temp.mp3".
> Behavior:
> No sound has been played.
> When I manually stop the music by triggering the click event of a "stop" button, the error function is invoked and "Audio Error" alert message is shown.
> Latest update: this was also confirmed in a device deployment. Same behavior as described above. The device is Moto XT800 running Android 2.2
> Here is the log after the "start to play" button is clicked. 
> Log Cat:
> 07-27 00:29:47.982: D/CordovaLog(918): Manifested src string: /android_asset/www/temp.mp3
> 07-27 00:29:47.982: D/CordovaLog(918): file:///android_asset/www/index_tool.js: Line 145 : Manifested src string: /android_asset/www/temp.mp3
> 07-27 00:29:47.982: I/Web Console(918): Manifested src string: /android_asset/www/temp.mp3 at file:///android_asset/www/index_tool.js:145
> 07-27 00:29:47.991: D/CordovaLog(918): before: null
> 07-27 00:29:47.991: D/CordovaLog(918): file:///android_asset/www/index_tool.js: Line 150 : before: null
> 07-27 00:29:47.991: I/Web Console(918): before: null at file:///android_asset/www/index_tool.js:150
> 07-27 00:29:48.021: D/CordovaLog(918): [object Object]
> 07-27 00:29:48.021: D/CordovaLog(918): file:///android_asset/www/index_tool.js: Line 154 : [object Object]
> 07-27 00:29:48.021: I/Web Console(918): [object Object] at file:///android_asset/www/index_tool.js:154
> 07-27 00:29:48.091: I/Deprecation Notice(918): Replace ctx.getActivity() with cordova.getActivity()
> 07-27 00:29:48.121: D/AudioPlayer(918): Send a onStatus update for the new seek
> Here is the essential section of the code:
> function error_error(e) {
> 		alert('Audio Play Error.');
> 		alert(e.message);
> 	}
> 	function playAudio(src) {
> 		if (device.platform == 'Android') {
> 			src = '/android_asset/www/' + src;
> 		}
> 		my_media = new Media(src, success, error_error);
> 		$("#status_title").text('Sensing');
> 		$("#status_text")
> 				.text(
> 						'System is sensing the sensor... Press stop button when you want to stop this process.');
> 		$("#inner_start").hide();
> 		$("#inner_stop").show();
> 		my_media.play();
> 	}
> 	// play audio main function, callback function and exception handler
> 	$('#inner_start').live('vclick', function(e) {
> 		// alert('inner start tapped.');
> 		playAudio('Nokia_Tune_Dubstep_Edition.mp3');
> 		return false;
> 	});
> It looks like the app found the file, but there is just no sound being played. I also checked the emulator, audio playback/recording are both turned on. In addition, I checked /res/xml/config.xml, the audio handler is there. Permissions also include all necessary configurations such as WRITE_TO_EXTERNAL_STORAGE.
> I cannot find a difference from the log recorded at a normal playing. I can play online music through the HTTP URL, but not local audio files.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira