Thanks Kevin. I have another question. Can I produce sound or tone
inside my JAVA code instead of reading a sound file from somewhere
when the user touches a point on the screen? This way I just have to
"emit" a sound at some frequency/pitch (defined numerical value),
based on a touch event.

On Jan 21, 4:02 pm, Kevin Duffey <andjar...@gmail.com> wrote:
> Well firstly, let me stress that music apps generally require a little bit
> more than basic java knowledge, and more so, basic android knowledge. Aside
> from that, Android presently is difficult at best for real-time touch/play
> sounds sort of apps. I've got a project started to make a MPC like app, but
> have been reading that presently the ability to make low-latency music apps
> is pretty much impossible for a few reasons. The main one being, the latency
> between touch events and actually firing sounds quickly is a killer. Beyond
> that, most apps that utilize any sort of say effects like delay, echo, and
> play multiple sounds simultaneously are going to require the NDK for its
> much faster performance. The problem is, let's say you load up 5 samples
> into 5 buttons. The user presses one, you open the Android sound mechanism
> and play that sound. Great..it works. There are lots of apps (Chuck Norris
> comes to mind on Market) that offer buttons that you press and play some
> sound bit. If you start pressing these buttons rapidly tho things start to
> fall apart. But if you do use the NDK to "mix" the various audio sounds into
> one mxied audio bytestream to play back, the problem there is the JNI
> overhead of sending the various java loaded sound byte streams to mix thru
> JNI to the NDK, then it mixes really fast, but the NDK doesn't have access
> to the sound hardware.. so now that mixed byte stream has to come back thru
> JNI to Java to be played. Hence, the double latency issue presently. This
> also bites high framerate video games.. the same sort of issue with sending
> bitmap images to the NDK layer to do fancy things or construct a frame,
> requires (at least if I've read correctly) coming back thru JNI to put the
> image on the screen. OpenGL is implemented (1.0 I think) for Java on
> android, so you can get fairly decent graphics going.. and as I understand
> it the Java implemention uses JNI calls to the OpenGL layer too.
>
> There are a couple things coming hopefully soon to Android. The first bieng
> OpenCL to allow better hardware access to sound streams. I don't know the
> details of it yet, but I think it's the same API used on iPhone for low
> latency audio playback. AS well, I think OpenGL 1.1 or something like it is
> coming soon. The main thing is, both of these I think..again..not for sure..
> give the NDK direct access to the audio and video buffers so that you can
> use NDK code to mix audio and play it directly, as well as do video things
> like redraw a frame, then blit it to the screen. I am not for sure on this..
> hopefully someone can give a better idea of this.
>
> On Tue, Jan 19, 2010 at 8:05 AM, Jack <jackzo...@gmail.com> wrote:
> > Hi, I am thinking of developing a simple Android application that lets
> > users compose music on Android phones.
>
> > I am new to the Android platform. I have some coding experience in
> > Java that involves being aware of basic OOPS and Java concepts and
> > developing some small Java applications(less than 1k lines of code). I
> > have set up Android on my Linux system and have been able to run a
> > "hello World" application.
>
> > I want to develop a simple Android app in a month wherein users can
> > compose music. What I want to do is this- A  touch on the screen
> > should produce/emit a sound/tone. Touching different parts of the
> > screen should produce/emit sounds of different pitch levels/
> > frequencies. Once this is done I want to improve the UI and add some
> > basic features of playback, "clearing" currently selected tones on the
> > screen.
>
> > How do I start doing this? Also, given my limited experience with
> > java, how should I divide the tasks so that I can finish this in a
> > month?
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Beginners" group.
>
> > NEW! Try asking and tagging your question on Stack Overflow at
> >http://stackoverflow.com/questions/tagged/android
>
> > To unsubscribe from this group, send email to
> > android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to