PCM to G711

97 views
Skip to first unread message

ProfessorMD

unread,
Jan 31, 2010, 8:17:38 AM1/31/10
to j4sc
Hi Raj,

Thank you for replying to my last post. Now that I know you are up.
Firstly, Good Morning. Again amazing work.
My second question is that I have been having a lot problem with
converting audiofiles from PCM wave to G.711. I have had to do this
from outside of java manually with Goldwave which works really well
but I'd like to do this inside java. Previously, I have look inside
another piece of the test code, which is currently on the top of the
discussion in the SpinVox forum and they are using some kind of base64
encoder but it failed to work with my PCM audio files (16000 hz,
mono). Any solutions??

Raj Patel

unread,
Jan 31, 2010, 9:25:49 AM1/31/10
to j4...@googlegroups.com
Hi ProfessorMD, and good afternoon

Glad you like the API!

I think you need to use the Java Sound API which allows you to convert
from PCM to G.711

Ive found jsresources useful in that past for this sort of thing

http://www.jsresources.org/examples/AudioConverter.java.html

Have a look at this and should help you achieving what you want. You
may see references to ulaw and alaw. These are versions of G.711 and
as far as know, these are both ok to use with SpinVox API

Regards

Raj

> --
> You received this message because you are subscribed to the Google Groups "j4sc" group.
> To post to this group, send email to j4...@googlegroups.com.
> To unsubscribe from this group, send email to j4sc+uns...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/j4sc?hl=en.
>
>

--
Raj Patel
Mobile: 07957 446908
Home: 0208 371 1958

Roger Ng M.D.

unread,
Feb 1, 2010, 5:13:31 PM2/1/10
to j4...@googlegroups.com
It worked but I had to convert the stream back into a file. Is there
a way to not have to write to the disk drive? Is there a way to store
things somewhere else?


Roger Ng

Raj Patel

unread,
Feb 1, 2010, 6:19:30 PM2/1/10
to j4...@googlegroups.com
I'm guessing the ideal approach would be something as follows

1. Read the PCM file in as a byte array
2. Convert the bytes to G.711 alaw or ulaw as required
3. Construct the J4SC Audio object using the G.711 bytes

You may want to see if the above approach works for you

Reply all
Reply to author
Forward
0 new messages