Iphone Sound Format

Previous topic - Next topic

PaLe

#30
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:

Code (glbasic) Select

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]

Kitty Hello

I have an MP3 playing in Wumbo's Adventure. I really think I am...
yes. 128 kbps. I think constant bitrate.

Leginus

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.

Ian Price

#33
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.
I came. I saw. I played.

Leginus

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:

Ian Price

Images are the same - whatever size they are prior to loading, once in memory they occupy the same amount of RAM.
I came. I saw. I played.

PaLe

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:

Code (glbasic) Select

// --------------------------------- //
// 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

Ian Price

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 came. I saw. I played.

PaLe

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

Leginus

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:

Slydog

Found this article talking about iPhone sound formats, kinda useful:
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.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]