Solved

Playing Audio Using java in AU Format

Posted on 1997-09-25
6
697 Views
Last Modified: 2011-10-03
Dear sir,
We are involved in Developing Audio Conferencing system using Java.
Audio capture is achived using WINAPI calls (Java Native Methods) with
wave recording format as :

 waveformattag == WAVE_FORMAT_PCM
number of channels == 1
Bitspersample == 8
no. of samples per second = 8000
This audio sample is converted into .au format by adding header
information.
viz
struct {
int magic =  0x2E736E64;
    int dataLocation =24;
    int dataSize = filesize ;
    int dataFormat =2;
    int samplingRate =8000;
    int channelCount = 1;
}
 Playing audio is achived using audio.play method in JDK1.1.3   (& Sun
audio Package).
The problem is, the audio quality is diminished while playing using the
above mentioned method.
While it is good when done with Mutimedia Media Player(available with
WIN95).
Kindly let us know what is the underlined problem. Awaiting your reply.

Regards
ECS Development Team
DSQ s/w Ltd, Madras, India.

0
Comment
Question by:ecsdsq
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:gwalters
ID: 1227461
You can't convert WAV to AU by adding a header.  WAV is PCM, and AU uses ULAW.
0
 

Author Comment

by:ecsdsq
ID: 1227462
Thanks Gwalters for your immediate response. Actually we are struggling for recording the sound using ULAW only. But the SB16 of Creative Labs does not allow us to do so. So we are recording th raw samples in PCM format and then adding the 32 bit header corresponding to the .au format thinking that we will get the audio format. We would like to have more details about how to record in .au format with the SB16 of creative labs in the Windows-95 platform.
Expecting your fast response,

DSQ ECS team.
0
 
LVL 3

Expert Comment

by:gwalters
ID: 1227463
Yes, that's where my limited knowlege ends.  I think you'll probably need to write/find a conversion program.

I used a program called "sox" (SOund eXchange), that converts almost any format to almost any other format.  Sox comes with source code, so you probably can port the appropriate parts to java (or just use it directly as native code).

0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 10

Accepted Solution

by:
kollegov earned 200 total points
ID: 1227464
http://www.spies.com/Sox/
sox homepage.
sources available for download from here.
not bad idea to use sources, or even may be
to convert by single command in batch file

sox filename.wav filename.au

I used Goldwave to convert files when needed.
(windows 95 version)
0
 
LVL 10

Expert Comment

by:kollegov
ID: 1227465
Found one more, which can be interesting to you:

http://www.scrawl.com/store/

SoundBite v1.0
Audio Recording/Playback in Java
using Native Methods (Windows 95/NT)
Shareware
0
 
LVL 10

Expert Comment

by:kollegov
ID: 1227466
And ONE more exactly what you need!!!!
Wav2Au converts Microsoft .wav files to the .au format
 supported by Java. It reads mono or stereo, 8 or 16 bit,
 PCM-encoded files at any reasonable sampling rate,
 and writes the 8-bit, 8012 Hz sampling rate, mono,
 mu-law encoded files supported by Java. Full source
 code is included.
http://saturn.math.uaa.alaska.edu/~hursha
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question