Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Visitor
Posts: 1
Registered: ‎10-02-2013
My Device: BlackBerry Z10
My Carrier: O2

"No such file or directory" when using mmr_input_attach(...) to attach an MP3 file

[ Edited ]

This is my code:

 

char workingdir[PATH_MAX];
char audiofileurl[PATH_MAX];
int ret;
	
getcwd( workingdir, PATH_MAX );
sprintf( audiofileurl, "file://%s/data/cache/%s", workingdir, pFileName );

Assert( m_pMediaPlayerConnectionHandle == NULL );
m_pMediaPlayerConnectionHandle = mmr_connect( NULL );
Assert( m_pMediaPlayerConnectionHandle != NULL );

mode_t mode = S_IRUSR | S_IXUSR;
m_pMediaContext = mmr_context_create( m_pMediaPlayerConnectionHandle, "MyAudioStreamer", 0, mode );
Assert( m_pMediaContext != NULL );

const char* audiourl = "audio:default";
m_AudioOutputID = mmr_output_attach( m_pMediaContext, audiourl, "audio" );
Assert( m_AudioOutputID > -1 );

// put it in a list, so we can specify repeat below
ret = mmr_input_attach( m_pMediaContext, audiofileurl, "autolist" );
const mmr_error_info_t* err = mmr_error_info( m_pMediaContext );

 

mmr_input_attach is returning -1, and when I look at the error it says "No such file or directory".

The audiourl variable contains:

 

file:///accounts/1000/appdata/namespace.application/data/cache/music.mp3

 

(I'm not pasting the real namespace for legal reasons).

 

I've used the shell to navigate the directories on my device and confirmed that the MP3 file is definitely at that location.

 

EDIT: I've also confirmed the case-sensitivity of the string (since apparently everything is case sensitive in BlackBerry OS 10). I've also performed a chmod -R 777 on my entire /data/cache/ directory to ensure the app can access the file.

 

 

So is there something obvious which I'm missing?

 

 

I've noticed all the examples I've read store their music in /app/native/, whereas I'm storing it in /data/cache/, but I don't think that could cause the issue since the BlackBerry documentation states that the app has read/write access to /data/cache/

 

Thanks