Discuss PocketC for CE (including Desktop Edition)

Postby wittchow on Tue Dec 12, 2000 1:40 pm


I am trying to code an audio editor / synthesis tool in pocket c. Wave form calculation works fine yet, but sound playback / writing wav files makes difficulties:
The wave()-function does not allow to write data to a playing (looped) wave, so this function can't be used as audio buffer. A workaround for this could be two files playing alternating, writing only to the one not currently playing. But then wave() would have to be included in the main loop which means bad timing.
Finally every wave starts/ends with an awful click, even when looped.

An other problem is how to write wav files quickly:
The wave form to write is held in an array of ints or chars. Writing an array to a file with a loop of writechar() takes rather long. Since wav data are 16-bit they can also be stored as string and be written with one writechars() command. This is much faster, but converting an array to a string with a loop of strsetc() is just as slow as the loop of writechar().
Is there any way to write an array of chars to a file or to convert the array to a string with only one command?

Thank you

Oliver Wittchow
Posts: 4
Joined: Sat Dec 09, 2000 9:22 pm

Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 6 guests