언어 설정

Menu
Sites
Language
not able to play audio file on button click

hi

i created a button and its click is functioning prorperly, but i wanted to add an audio file to that click.

In onActionPerformed i did this:

i used the Player class object to openfile and to play.

filepath that i have given in my local drive path D:/TizenD/SAIapp/11.mp3.

where SAIapp is app name, audio file is in same folder.

please help what can be the matter.

Edited by: Brock Boland on 17 3월, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

7 댓글
Marco Buettner
You can not playback a local file you have to push the file on the emulator or device o0
Ravender Singh Dahiya
please tell how to push it on emulator.
Siddharth Singh
Once u keep the file in data folder it will be automatically pushed on to the device filesystem while you run your app.
Siddharth Singh
Keep the Audio file to below location (in data folder inside your project workspace): ...\workspace\Your_App\data Also,when opening the file you can directly give the filename such as 11.mp3.......no need of giving the fullpath.
john Smith
hi, Keep your audio file in accessible path folder of your application. Like data, shared/data folder. After that to get the file from path use String path = App::GetInstance()-> AppDataPath() + L "filename"; after that try to play that file.
Ravender Singh Dahiya
hi do i have to use Construct() before all these? __player.OpenFile(filepath, false); __player.Play(); if yes then how to pass IPlayerEventListener's object to construct();
Siddharth Singh
r = __player.Construct(*this, &bufferInfo); String filePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"data/test.mp3"; r = __player.OpenFile(filePath, false); r = __player.Play(); You can also follow this tutorial.....it explains well all ur points. https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.native.apireference%2FclassTizen_1_1Media_1_1Player.html