2010年11月1日星期一

Mac Shell Script

In our project, the screen delay whenever any sound is played.
The reason is that it used AVAudioPlayer for playing all sounds and musics.
However I found that AVAudioPlayer is more for streaming but not caching, we need to shift to OpenAL for playing sounds.

After writing a class for OpenAL, I used much time to find out why it doesn't work.
The final answer is: it works, but it is not compatible with the original audio format ".m4a".
Then I need to find a way to convert them to ".caf" format which works well with OpenAL in iPhone.

Well, the next step is to find a way to do batch convertion with afConvert.
Finally comes to the topic: using shellScript on Mac.

(the above topics: OpenAL, afConvert to caf, afConvert batch convertion, will be discussed later)

Here is a gd answer on StackOverFlow (as always).

And it is a script for deleting all files with extension .caf in a directory: "find . -type f -name "*.caf" -exec rm -f {} \;"

沒有留言:

發佈留言