Can i save byteArray to mp3 file? - actionscript-3

Well, i am recording the voice from heaphone and the sound data is stored in ByteArray at runtime, now can i stored as mp3 ??
i want to save as mp3 file on the client system.. For that, i think i have to use air application.. Am i right?

I found this link where someone used Alchemy to convert to MP3.

Related

AS3 - Need to save the mp3 file after cutting from beginning and end

I've to develop a mp3 audio cutter(similar to mp3cut.net), in that user can cut the audio from beginning or from end.
I'm able to open and save the .mp3 file on local system without modifying the bytearray. But need to save the file after trimming. I tried to extract the bytearray using sound.extract() but after saving the bytearray .mp3 file is not playing.
any help is greatly appreciated
Thanks
Are you encoding the bytearray or are you saving the bytearray to file?
You need encode the bytearray
try with this:
https://github.com/kikko/Shine-MP3-Encoder-on-AS3-Alchemy

AS3 Air — Check a Zip to get Audio File

I have a problematic situation that I wish to expose you because it contains some opposites constraints. Maybe someone will have an idea on how to unlock my problem.
I'm going to make a mobile application with ActionScript 3 and Air for iOS and Android. This application has to download zip file which it uses to display text, bitmap and sound.
This last one is the problem.
After some research, one of the best way I found to check a zip file is FZip, but it allows us to get data from zip on a ByteArray form. And a Sound can't be converted from ByteArray. ( That's what a lots of results about it appear to say. )
One of the solution proposed is to put the ByteArray of a sound and put it in a SWF. Then take the SWF from the zip to get the Sound.
I can't do that because this zip will be uploaded from a admin interface used by anybody. I can't force them to use Flash.
I have few potential direction where I ask for your advices :
• Use Code or Native Extension ( iOS and Android ) to check a zip without files read in ByteArray
• Convert a ByteArray into Sound without have to pass it in a SWF
• Dynamicly create a SWF with the ByteArray of a Sound
• In the last possibility, another way to drag and download few files together which can be consulted in another format than ByteArray ( Like a iOS Bundle but with android too )
Thanks a lot to help me,
You can simply write the ByteArray on a local mp3 (or mp4) file and then play it, to write a ByteArray to file see documentation here.

How to merge to sound files in WP8?

It it possible to merge sound captured from microphone with an mp3 file selected and save as a new mp3 file in windows phone 8?
Does naudio have wp8 support??
Possible, yes. But you would have to decode the mp3 file into raw PCM data that matches the waveformat of the captured audio data, merge the pcm data (either an additive or mean merge or you'd simply add the captured audio data to the end of the pcm data from the mp3) and encode your new pcm data to MP3. There are plenty of libraries out there that support encoding/decoding of mp3 data and you might even find one that would let you decode/re-encode only the sub-sample of the mp3 file that you're interested in merging with captured audio data.
NAudio has, AFAIK, no WP8 support. I believe that they're currently working on Windows Store App support.
You would need to use WASAPI - which is a native-only API - or the Microsoft.XNA.Audio.Microphone-class to capture data.

Converting Mpeg file to flv and simultaneously playing the converted file in flash cs3 using as3

I have an mpg file which I want to convert to flv format, but I have a requirement that while converting the mpg file, I also have to simultaneously play the converted flv file in the flash cs3. How to do it? I am using cs3 and as3.
If you want to convert your files programmaticly then use ffmpeg. This is a commandline tool which can convert video files to nearly everything. You have to execute ffmpeg with the correct params and wait until the video is ready. This works only on serverside. Means the flash client loads up the video file to the server. There it gets converted. You can execute ffmpeg with any serverside language like php.
Sadly I have no idea if it is possible to watch the video while converting. I think not but maybe someone else knows more.

Flash record sound locally

Using flex,As can we record sound from microphone and store locally and and upload later?? Is there any relevant links to this please indicate
Check this link for how to use the microphone to record and use FileReference to save the recording
It is possible to record audio using the Microphone API SAMPLE_DATA event. The data property of the event is a ByteArray with the audio data.
A web based Flash application could copy these data samples to a data structure in memory and prompt the user to save the data to a local file. An AIR application would be able to write the data to the file system or SQL database directly.
See the links below for accessing audio from the microphone in ActionScript:
http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d1d.html
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Microphone.html
It may help to encode the data in a standardised format to help with reading and editing later (WAV or PCM). You may also want to use compression to reduce the file size for transmission (eg: Ogg Vorbis codec from Adobe).