19 Jun '13 - 01:35 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Getting BASS to play music from internal music library on iOS  (Read 592 times)
quartz3d
Posts: 5


« on: 22 May '12 - 16:01 »
Reply with quoteQuote

I'm trying to get Bass to load in music from the iOS music library (using StreamCreateFile), but every time I load the file I get the FILEFORM error. I feel confident that my code is correct, as it is able to load in a variety of file formats provided they are an external URL. However, once file path is provided for a song within the application document folder, I get the error. I'm moving the song from iTunes to the documents folder. Any ideas why this would be, and how to resolve it?
Logged
Ian @ un4seen
Administrator
Posts: 15363


« Reply #1 on: 22 May '12 - 16:59 »
Reply with quoteQuote

A BASS_ERROR_FILEFORM error indicates that BASS was able to open the file, but it was unable to recognise/handle the file's format. Please confirm what the file's format is, and how you're importing it into your app's sandbox. If you aren't already doing so, you could try using this class to do it...

   https://bitbucket.org/artgillespie/tslibraryimport
Logged
quartz3d
Posts: 5


« Reply #2 on: 22 May '12 - 21:06 »
Reply with quoteQuote

After spending a better part of the day trying to get this to work, I'm still having issues with BASS reading the file.

Sending one of these paths into Bass:
/localhost/var/mobile/Applications/684062D5-9670-4FFD-B756-726EF40798C7/Documents/song.m4a
/private/var/mobile/Applications/684062D5-9670-4FFD-B756-726EF40798C7/Documents/song.m4a
/var/mobile/Applications/684062D5-9670-4FFD-B756-726EF40798C7/Documents/song.m4a

Using code (c#):
BASS_SetConfig(34, 0);
BASS_Init(-1, 44100, 0, 0, IntPtr.Zero);
BASS_StreamCreateFile(false, path, 0, 0, BASSFlag.BASS_UNICODE);

The file is being properly copied into the sandbox document folder, but the file cannot be loaded. I can download the documents directory via Xcode and play the file in iTunes on my mac. Any ideas on what's going on?
« Last Edit: 22 May '12 - 21:41 by quartz3d » Logged
Ian @ un4seen
Administrator
Posts: 15363


« Reply #3 on: 23 May '12 - 15:00 »
Reply with quoteQuote

Please upload the "song.m4a" file that you took from your app's sandbox to have a look at here...

   ftp.un4seen.com/incoming/
Logged
quartz3d
Posts: 5


« Reply #4 on: 23 May '12 - 16:15 »
Reply with quoteQuote

No need, got it working. The issue was related to complications from the native bridge between C# and C/Obj-C. Thanks for all your help!
Logged
gotoimran
Posts: 2


« Reply #5 on: 20 May '13 - 15:58 »
Reply with quoteQuote

hi,
i had the same issue. you were need to paste the solution as well when you resolved the issue.
here is the solution the i found for my problem.
http://stackoverflow.com/questions/9749369/weird-behavior-of-fopen-on-ios

thanks
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines