Droid-Bird
Droid-Bird

Reputation: 1505

How to playback 3gp files in Java?

I have a java program that receives a 3gp audio file (single file, not stream) sent from the sender in an array of bytes (byte [])

Now, either I need to play this file or, I should be able to save it in 3gp format

Example:

byte[] Audiobytes = received3GPAudioFlie();

Now I want to be able to deal with this Audiobytes in the example. I have two separate goals,

  1. I want to save it as a 3GP file

  2. I want to be able to play it as audio file. Thanks.

Please help!

Upvotes: 0

Views: 723

Answers (1)

Pepe
Pepe

Reputation: 6480

If by handle you mean

1) Write bytes to file (save the file) then you can do it as follows:

  fileOutputStream fos = new FileOutputStream(strFilePath);
  fos.write(AudioBytes);

2) Play the file Playing audio files in Java

Upvotes: 1

Related Questions