Domanda

The Android app I'm building has to listen to music (either playing on the phone or picked up by the device's mic) and then do something based on the music.

So what I was thinking of doing is to listen for the tempo/bpm of the music playing and then do some math with what I get to influence the background colour of the app.

I need something similar to what Malcolm McRoberts asked for here - analyze the music and then do something. He said that he was able to use Echo Nest to reach his goals, but he's not explaining how (yet).

I need something very similar to what elucid135 asked for here - listen for beats per minute (bpm) and then do animations based on that. But my platform is very different.

Any Android ideas?

Perhaps someone with knowledge of Android AudioTrack, MediaPlayer or Audio Capture can give some input.

EDIT:

It seemed that no one gets what I'm asking, so I'll try to rephrase:

Using Android, I want to record music via the device's mic. Then I want to analyze what has been recorded to find the beat of the music recorded. Based on that beat, I want stuff to happen in the app.

I know how to record music. What I'm looking for is advice on how to identify the beats in the music.

Hope that clears it up.

È stato utile?

Soluzione

" has to listen to music"
..."either playing on the phone"
Wont work, Android doesn't support that.

..."or picked up by the device's mic"
Will work in some cases (i.e. when using the loudspeaker in a low-noise environment), but quality will be pretty bad.

Another alternative is to use the Visualizer class to grab audio data from session 0 (the global output mix). The quality of the audio will be pretty bad, but it might be good enough for BPM calculation, and it will work even if the music is routed to a headset.

Altri suggerimenti

I'm working on a similar problem. Try looking into TarsosDSP link. It is a java based audio signal processing library which provides classes that can identify beats which could then be used to determine tempo and it works with Android.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top