Playing WAVs from resource file?

Login to reply to this topic.
Fri, 2003-10-03 10:12
Joined: 2003-09-15
Forum posts: 162
Is it possible to compile wav files into a single resource file
in a similar manner to when bmp files are compiled into an .mbm?

The idea is not to have loads of wav files to manage on disk.

cheers
paris.

~~~~


Fri, 2003-10-03 11:40
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 1886
Playing WAVs from resource file?
You can take a look at CDirectFileStore.

This is not really resource files but will give you the possibility to put several Wavs into one file (but you will need to play them from memory).

Eric

Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Fri, 2003-10-03 12:31
Joined: 2003-09-15
Forum posts: 162
Playing WAVs from resource file?
>(but you will need to play them from memory).

hmm.. now I'm wondering if my app will become unacceptably bloated
if I preload all my sound effects into RAM?
I have about 15 8bit-8khz sounds totalling 200k.

My understanding is that the Nokia 3650 has 4MB of internal memory for application and storage use and the maximum program heap size is up to 1.4 MB.  

I presume the 4MB is storage disk space and the 1.4MB is the internal
memory (RAM) size (correct me if I'm wrong).
(not sure of 7650 specs yet.)

I assume that if I am considering preloading images and sounds
in this way I should really try to stay below 200KB?
(the docs point recommend this.. but why??).

It isn't absolutely essential that all wavs are in memory, so if there is a good reason why I should avoid doing this where possible I'd be interested to know.

cheers.

paris.

~~~~

Fri, 2003-10-03 19:43
Joined: 2003-09-15
Forum posts: 162
Playing WAVs from resource file?
I can see how objects can be serialised to a CDirectFileStore
but I'm not sure how to treat a wav file.  How do you actually inject  the
wav file's binary data into a store?

I already have a CSoundObject class for each loaded wav  but there's no point
storing that class because it only has a handle to the wav file on disk - whereas I
want to store the ?whole? wav file in memory.

I'm hoping that (ultimately) I can use swizzling to get at each
stored wav file without necessarily loading the whole file store itself.
(This is all hypothetical mind you, based on what I've read in the docs)

paris.

~~~~

Fri, 2003-10-03 20:49
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 1886
Playing WAVs from resource file?
Then you can write internalize/externalize methods for your CSoundObject and yes, it should probably read/write binary streams of pcm data.

Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Fri, 2003-10-03 21:19
Joined: 2003-09-15
Forum posts: 162
Playing WAVs from resource file?
..then CSoundObject ::Internalize() could extract the PCMdata and pass it to CMdaAudioPlayerUtility::NewDesPlayerReadOnlyL(PCMdata)??!!

..hey now, it's a crazy idea...but it might just work! Evil

nice one Eric.!

paris.

~~~~

Sun, 2003-10-05 11:56
Joined: 2003-09-15
Forum posts: 162
Playing WAVs from resource file?
..The only problem now is how to correctly convert a wav file into
a TDescC8 buffer that can be passed to NewDesPlayerReadOnlyL(..) Huh

Anyone aware of any wav2ascii utilities that do an ascii dump of a
wav file in 'R''I''F''F'.. ascii format?

..I don't know if this will even work!
..but hey, nothing ventured, nothing gained Wink

paris.

~~~~

  • Login to reply to this topic.