3

I am currently working on a game where I need to be able to record and analyze sound. I basically need to analyze the sound from the phones microphone in (close to) real time and visualize this. It is similar to this question, only I want to do it using cocos2dx if possible.

The task I want to perform is similar to what is discussed this post: Capturing Sound for Analysis and Visualizing Frequencies in Android , the difference being I want to use cocos2dx for the visualization.

My question is firstly: is there some way in which cocos2dx supports audio recording. I've searched a bit, but haven't managed to find anything useful. Secondly, if not, how can I link the Java/Obj C platform specific sound recording to the drawing/user interaction done in the cocos2dx c++ code.

Any suggestions or examples of similar apps would be greatly appreciated.

Community
  • 1
  • 1
Reason
  • 1,410
  • 12
  • 33
  • You are aiming for a multi platform solution? Objective C and Java don't mix on iOS. On Android are you using cocos2d-android? – Max MacLeod Nov 12 '12 at 15:00
  • Yes I aim on making it cross/platform. I meant linking Java/C++ on Android and Objective C/C++ on iOS. I want (mostly) the same cococs2dx code on both but platform specific sound recording. Unless sound recording is doable through cocos2dx, that is. – Reason Nov 13 '12 at 09:41
  • I'm no cocos2d expert but I'd guess it has no sound recording ability. So, on iOS you'll be using AudioUnit, AudioQueue, or the AV media framework. – Max MacLeod Nov 13 '12 at 10:08
  • Max: my problem is I don't know how to connect any of the platform specific sound recording mechanisms to cocos2dx. Any idea of how to do that? – Reason Nov 13 '12 at 12:47
  • Probably cocos2dx uses OpenAL for sound. So you would record the audio to a buffer then play that buffer back using OpenAL – Max MacLeod Nov 13 '12 at 13:34

1 Answers1

1

This comes really late but I was looking for same thing through cocos2dx and I found this good helper classes at cocos2dx forum. It mainly shows manager and helper classes for iOS but it is a healthy start for implementation. For someone looking further follow the link.

http://discuss.cocos2d-x.org/t/microphone-recording-for-ios-and-android-using-cocos2dx/15254/4

umerfox
  • 41
  • 3