Part Number: PROCESSOR-SDK-AM335X
I have problem with AudioTrack library in my Android project, I'm trying to play sine wave using 3.5mm connector on my AM335x board, but whenever I run my app, it throws an exception, like there is no audio device... This app work flawlessly on my phone, either through speaker or headphone jack. Here is sample of code I'm trying to run:
double[] mSound = new double[4410]; short[] mBuffer = new short[duration]; for (int i = 0; i < mSound.length; i++) { mSound[i] = Math.sin((2.0*Math.PI * i/(44100/frequency))); mBuffer[i] = (short) (mSound[i]*Short.MAX_VALUE); } mAudioTrack.setStereoVolume(AudioTrack.getMaxVolume(), AudioTrack.getMaxVolume()); mAudioTrack.play();
mAudioTrack.play() throws exception every time... Is there any other way to play sound on this board?