What's the best sound format to use on the iphone?
Is ogg supported though GLbasic on iphone?
I was reading that it is supported on the pc with the correct codec, but as i understand the Iphone doesnt have the ogg codec.
So that leaves me with the dilema of what is the best sound format for iphone.
Oh my aching head.
Any help would as always be greatly appreciated :nw:
Do i take it that everyones Iphone games have no sound :whistle:
OGG is supported on the iPhone and is the best format to use.
Excellent news. Thanks MrTAToad. I can now crack on with the sounds then.
Apple have now recieved the extra info from me, so hopefully my developers key will be here soon.
Hi,
I'm very happy if GLB support .ogg sound but my iPhone 3G (os4.1) doesn't play any .ogg format. O_O
I tried to insert in GLB code or play directly and didn't work.
Anyway, my problem is ALSO for WAV format.
I write some examples with various WAV format (maybe are correct in 16bit-PCM-22.050Khz or 32bit-flat-44Khz, created with Audacity on Mac) but I don't hear anything.
The code show me on screen that the sounds are correctly loaded in the buffer (I set 1 loop, volume=1 and mode from -1 to 1 for try left/right) but, I repeat, I hear nothing. :'(
Which is the correct WAV format ? how to hear .ogg format?
Can anyone give me where download one GOOD (and right) sample for test it?
Thanks
Paolo
I also did try a OGG on my iPhone4 4.1 and it doesnt play. I thought it was bad file location or bad ogg generated...
Pale - can you make the WAV available ?
.WAV definitely does work on iPod Touch 3G - my current WIP and Bli2X! both play .WAV sounds, without problem.
Quote from: MrTAToad on 2010-Oct-05
Pale - can you make the WAV available ?
:whistle: ...avilable??? I'm a little bit "rude"... What mean??
Can we download it ?
OK, i unterstand
this is the game that I try to convert and test it on the iPhone.
http://dl.openhandhelds.org/cgi-bin/gp2x.cgi?0,0,0,0,25,2820
the .wav files are in various sample-rate under Media directory (the only one!); rename the TUcs.app folder if you unzip it on Mac ;)
thanks for your support.
Paolo
I notice that you require the ENTER key to be pressed for selecting items. Unfortunately I have a mini-keyboard, which doesn't have the numeric number pad...
I can certainly hear the TUcS-_ciu.wav sample.
TUcS-uov1.wav (was just a blip, I presum)
TUcS-pepo.wav works too.
Which makes me wonder how you are loading the files.
Are you using forward or backward slashes for directory seperation ?
Ie LOADSOUND "R:/TUcS.app/Media/TUcS-pepo.wav",0,1
works fine
LOADSOUND "R:\TUcS.app\Media\TUcS-pepo.wav",0,1
does NOT work.
With regards to ogg on os 4.1. I cant test yet as i dont have my apple developers key yet, however, I play farm frenzy a lot on iphone to chill out now and again, and the sounds worked fine until 4.1, now the music doesnt play together with the sounds, the sounds dont always fire, and now and again it crashes, therefore, I wonder if there is an issue with something in 4.1 and certain sound code. Just a thought as I cant confirm
Quote from: MrTAToad on 2010-Oct-06
I notice that you require the ENTER key to be pressed for selecting items. Unfortunately I have a mini-keyboard, which doesn't have the numeric number pad...
I can certainly hear the TUcS-_ciu.wav sample.
TUcS-uov1.wav (was just a blip, I presum)
TUcS-pepo.wav works too.
Which makes me wonder how you are loading the files.
Are you using forward or backward slashes for directory seperation ?
Ie LOADSOUND "R:/TUcS.app/Media/TUcS-pepo.wav",0,1
works fine
LOADSOUND "R:\TUcS.app\Media\TUcS-pepo.wav",0,1
does NOT work.
The slashes are ok, I used a simple script.txt (see "TUcS-dat2.txt") for load GFX/SFX without change the code and all is done except the sounds...
I also explored and found my demo on User/application/directory and I hear all .wav with iPhone but no
t via glb Executables...
so I think that there is something in the code.... this evening I share an example.
Now time to go to work. :(
Have a nice day,
Paolo
A new problem!!! (apologize for English)
I hope that it's a (my) simple code error in the variable/declarations error.... :blink:
OK, now I explain.... This is my example link:
http://www.megaupload.com/?d=5LRCV7CG
Sorry for the code; the level of programming like's ZX basic ;) ... I only copied/pasted the load/play routines from the original code in a new project.
Please, First load the snd.glb project and run it with (F5 key or fn+F5 on Mac)... probably run well and you can hear the tunes (a loop of 3+1 different tracks)
after, try to compile a Windows EXE and run the executable.... the program ends... maybe it's a mouse click problem??? ::)
anyway, when I compiled for iPhone, the example start but whitout sound and, STRANGELY, the screen doesn't change (follow) the sound loop...
I mean it's a variable problem or what??? ( O_O and why??)
sorry if you spent time for any My mistake of programming... :nw:
Paolo
The file you are trying to access is temporarily unavailable...
Quote from: PaLe on 2010-Oct-06
A new problem!!! (apologize for English)
I hope that it's a (my) simple code error in the variable/declarations error.... :blink:
OK, now I explain.... This is my example link:
http://www.megaupload.com/?d=5LRCV7CG
Sorry for the code; the level of programming like's ZX basic ;) ... I only copied/pasted the load/play routines from the original code in a new project.
Please, First load the snd.glb project and run it with (F5 key or fn+F5 on Mac)... probably run well and you can hear the tunes (a loop of 3+1 different tracks)
after, try to compile a Windows EXE and run the executable.... the program ends... maybe it's a mouse click problem??? ::)
anyway, when I compiled for iPhone, the example start but whitout sound and, STRANGELY, the screen doesn't change (follow) the sound loop...
I mean it's a variable problem or what??? ( O_O and why??)
sorry if you spent time for any My mistake of programming... :nw:
Paolo
attached here...
[attachment deleted by admin]
sorry, I wrongly quote striketrough instead underline... I suggest First to Run the snd.glb in the IDE and then to test on windows/iphone.
The windows program seems to work perfectly - the only time it exits straight away is if you hold down the mouse button whilst compiling and then running (but that can easily be dealt with by checking MOUSESTATE at the start).
SETCURRENTDIR("Media")
percorso$=""
Also works fine.
On the iPhone, is the media actually present on the device ? You may need to copy it manually.
Yes, The Media directory contain all wav files. I checked it with an explorer file from Mac and also from iphone (iFile).
Do you tried it on iphone/ipod ?
Unfortunately no, dont have an iPod
I created .mp4 sound files in Nero Wave Editor and they work.
( for anyone that have an ipod/iphone and 10 minutes of freetime )
A M P O S, me a favour...
can you test the Xcode of SndTest.zip (of my previous link) or, better, compile the snd.glb also included on your ipod/iphone? I hear the sound in window executable but nothing on iPhone and I didn't understand yet why!
http://www.glbasic.com/forum/index.php?action=dlattach;topic=5159.0;attach=2432
Until tonite I could not test, my mac is at home.
It is driving me crazy.
First: the WAVs files are fine. I copied "B.wav" to /media on my current project, loaded and play, and it works.
The strange is that in your program, something is going bad: it should show "playing track n", play for a few seconds, next line, and so.
But in iPhone it just shows 4 times "playing track 1"
Something weird, but you has something.
Just try a step by step approach:
SETCURRENTDIR("Media") // seperate media and binaries?
LOADSOUND "B.wav",1,3
ch=PLAYSOUND(1,0,1)
repeat
print "test",10,10
showscreen
until n=1
this simple code does work on your wav files
Got my developers license through today :good:.
So I thought i would try and help with some testing.
I have put my game on iphone using wav files created using Audacity and everything works perfect.
I then change some of the sounds to .ogg using Audacity and changed the filenames accordingly (using case sensitive and then none case sensitive), these sounds didnt play on any occasion, yet the wavs were still playing fine.
I tried playing the oggs using playmusic and these didnt play either.
I suspected it could be Audacity that was the problem, so I downloaded an ogg NOT created with audacity and again no sound whatsoever.
Therefore, wavs are fine on pc and iphone, but oggs I cannot get to play on either with the same code.
Is this an issue with GLBasic at the moment, or is this an IOS4.1 thing??
Instead ogg use .mp4 or .m4r. Check my post in bug forum.
ah ok sorry didnt see that. Nothing like repeating stuff to fill up a forum :-[
ok now from scratch.... the devices could only play the formats for which are codecs available.
iphone -> Audio: drm aac,caf,aif,wav -> Video: m4v, mov
iPhone can also play music in mp4 and m4r format.
Quote from: ampos on 2010-Oct-07
The strange is that in your program, something is going bad: it should show "playing track n", play for a few seconds, next line, and so.
But in iPhone it just shows 4 times "playing track 1"
Something weird, but you has something.
Just try a step by step approach:
SETCURRENTDIR("Media") // seperate media and binaries?
LOADSOUND "B.wav",1,3
ch=PLAYSOUND(1,0,1)
repeat
print "test",10,10
showscreen
until n=1
this simple code does work on your wav files
Thanks everyone!!!
I tested your easy example with my wav and work fine!!!.
Ampos, You show me the same problem that I show in the 2 images attached....
This evening I'll try to check GLB command "SOUNDPLAYING" because I think that the problem is in it (on iPhone) or... it's better to contact Gernot?
[attachment deleted by admin]
I have an MP3 playing in Wumbo's Adventure. I really think I am...
yes. 128 kbps. I think constant bitrate.
Sorry to keep dragging this up and this is not a rant, but a mere confused plea for help. :giveup:
The SFX for my game were originially in wav format, but these equated to 6.5mb, so I changed them to ogg format which doesnt work on iphone it seems :(
After reading comments from Ampos, I converted these to mp4 which is a massive size reduction from 6.5mb to 445k. Obviously this would be amazing for iphone, however, these do not seem to play with loadsound, but after reading about loadsound, it says i can only load wav files.
I then looked at playmusic (which works fine), however, you cannot pre-load these sounds and playing one sound cancels another.
If this is the case then playmusic is not appropriate for sfx and therefore I am back to wav.
I really cant be using 6.5mb of sound as this is frightening, especially when a change of format drops them to 445k. Does anyone have a solution for SOUND FX on the iphone and not just playing them as music.
Thanks for all the help so far.
6.5Mb for sound is nothing, really. Even if you could use another format, once loaded into the iPhone, it would still occupy 6.5Mb in memory (once converted internally into a format it can use), which in this day and age is nothing. It's not like we're using 8bit computers anymore. Even the iPhone has at least 8GB of memory - that leaves plenty of space.
If GLB only supports .WAV for sounds on iPhone, then that's what you've got to use.
Ok thanks for that Ian. I didnt realise that it got converted once in memory, so I guess that it is really irrelevant on the initial sound format. Phew, panic over. :nw:
Images are the same - whatever size they are prior to loading, once in memory they occupy the same amount of RAM.
Ian,
I solved My problem about WAV Sounds on iPhone (CODE PROBLEM, BUT STRANGE ANIWAY) and I want to try other like MP3 or OGG, but if you say that the RAM is the same (sounds are pre-mapped?) which format suggest me to use in iPhone Apps (not for music, just effects)?
(I think the choose for iPhone is compromise in the time between downloading the application from the app-store and the loading time of resources when the program starts...)
...this evening stopwatch load times :D
------------------------------------------------------------------------------------------------------
AMPOS, This work without "strange output" on iPhone,Pc,Wmobile, GP2X-WIZ :booze:
// --------------------------------- //
// Project: SND
// Start: Wednesday, October 09, 2010
// IDE Version: 8.120
// CODE OPTIMIZED, FINALLY WORK !!! :)
SETCURRENTDIR("Media") // seperate media and binaries?
GLOBAL channel,wav_current,track_count,wav_base
SETSCREEN 320,480,0
// all wave's are loaded with buffer=1 for only 1 time played
FOR wav_base=1 TO (8*2); LOADSOUND CHR$(65+wav_base)+".wav",wav_base,1; NEXT
GOSUB Audio_NewWav
Game:
IF track_count=4 THEN wav_current=2
GOSUB Audio
WHILE SOUNDPLAYING(channel)
PRINT "track "+track_count+ " >>> WAV "+(wav_base+wav_current)+ " = channel "+channel,10,160
SHOWSCREEN
WEND
INC track_count
IF track_count=5 THEN GOSUB Audio_NewWav
GOTO Game
SUB Audio_NewWav:
track_count=1
wav_base=RND(7)*2
wav_current=1
ENDSUB
SUB Audio:
channel=PLAYSOUND(wav_base+wav_current,0,1)
ENDSUB
Quoteand I want to try other like MP3 or OGG
You have two problems there -
MP3 requires licenses, which equates to paying for them (in theory).
OGG doesn't seem to be supported on iPhod
ampos states that MP4 is supported for sound. I haven't tested this myself, but I have no reason to doubt him.
Quote(I think the choose for iPhone is compromise in the time between downloading the application from the app-store and the loading time of resources when the program starts...)
Really? You look at the size of the .app before downloading? :S Maybe if you have a slow net connection, but most people enjoy fast broadband nowadays. Loading probably wouldn't be an issue for music as they are streamed. 6.5Mb of sfx won't slow up your app too much. Lessen the apparent wait time with splashscreens - that's what they are for really, to hide the real load-times.
I try to think like a saver End User... :D
Sometimes yes, I look at the download size when I'm not at home... and when I can't use the Mac... recently iTunes10 crash on my Netbook with winzoz and plus my neighbor has changed the Wep password on his Net WiFi :P
My MobileProvider only accept 30MB (B for bit, they bastards!) of download, so 30/8 = less of 4MByte of download via Mobile.
Quote
MP3 requires licenses, which equates to paying for them (in theory).
OGG doesn't seem to be supported on iPhod
I think that i'll keep the wavs files in the program
Quoteplus my neighbor has changed the Wep password on his Net WiFi
Lol now THAT is a whole different can of worms that you should keep closed :whistle:
Found this article talking about iPhone sound formats, kinda useful:
http://www.sparrow-framework.org/2010/06/sound-on-ios-best-practices/ (http://www.sparrow-framework.org/2010/06/sound-on-ios-best-practices/)
Their recommendation?
QuoteUse CAFF (uncompressed) for short sound effects and AIFF IMA4 (compressed) for music. This is also the recommendation from Apple.
Why can't we use .MIDI files!?!? So small in size, but of course they can sound 'cheesy'. Great for simple games.