Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Playing Audio Using java in AU Format

Posted on 1997-09-25
6
Medium Priority
?
703 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

721 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