android: Detect sound level

Use mRecorder.getMaxAmplitude(); For the analysis of sound without saving all you need is use mRecorder.setOutputFile(“/dev/null”); HereĀ“s an example, I hope this helps public class SoundMeter { private MediaRecorder mRecorder = null; public void start() { if (mRecorder == null) { mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mRecorder.setOutputFile(“/dev/null”); mRecorder.prepare(); mRecorder.start(); } } public void stop() … Read more

Open source C# code to present wave form?

This is as open source as it gets: public static void DrawNormalizedAudio(ref float[] data, PictureBox pb, Color color) { Bitmap bmp; if (pb.Image == null) { bmp = new Bitmap(pb.Width, pb.Height); } else { bmp = (Bitmap)pb.Image; } int BORDER_WIDTH = 5; int width = bmp.Width – (2 * BORDER_WIDTH); int height = bmp.Height – … Read more

converting .wav file to .ogg in javascript

The Web Audio spec is actually intended to allow exactly this kind of functionality, but is just not close to fulfilling that purpose yet: This specification describes a high-level JavaScript API for processing and synthesizing audio in web applications. The primary paradigm is of an audio routing graph, where a number of AudioNode objects are … Read more

Read MP3 in Python 3

To make it easier I’d convert with some tools mp3 to wav, either: $ ffmpeg -i foo.mp3 -vn -acodec pcm_s16le -ac 1 -ar 44100 -f wav foo.wav or $ mpg123 -w foo.wav foo.mp3 Then read the WAV with one of the python WAV libraries. I’d recommend PySoundFile because it works with most generated WAV correctly … Read more

HTML audio can’t set currentTime

You need to do something like this (if you use jQuery) $(‘#elem_audio’).bind(‘canplay’, function() { this.currentTime = 10; }); or in Javascript var aud = document.getElementById(“elem_audio”); aud.oncanplay = function() { aud.currentTime = 10; }; The reason behind for this setup is you need to make sure the audio is ready to play.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)