mp3

Convert audio linear pcm to mp3 ( using LAME ) with the help of AudioQueueServices example in iOS

柔情痞子 提交于 2019-12-06 00:17:21
I am new in ios developement.I am encoding a LinearPCM to MP3 in iOS.I'm trying to encode the raw PCM data from microphone to MP3 using AudioToolbox framework and Lame.And although everything seems to run fine if i record .caf format . i am getting only noise and distortions present in the encoded stream. I'm not sure that I setup AudioQueue correctly and also that I process the encoded buffer in the right wat... My code to setup audio recording: sample project https://github.com/vecter/Audio-Queue-Services-Example - (void)setupAudioFormat:(AudioStreamBasicDescription*)format { format-

Is MIME type detection the best way to detect a kind of file?

只谈情不闲聊 提交于 2019-12-05 23:57:32
问题 I’m working on an upload form in PHP that must allow only MP3 files. When the upload is done, I analyze the file to check whether is it really an MP3. The first step is to detect the mime type as audio/mpeg . I use the libraries finfo_file() and works fine except that during the tests some MP3 files are rejected because their MIME type results as application/octet-stream . My questions are: Should my app definitely refuse those MP3 files? They actually play audio. Is there any reason why this

How to determine .mp3 bit rate without downloading it?

久未见 提交于 2019-12-05 23:45:36
I have a list of .mp3 files over the web and I would like to get the highest quality file. Quality in multimedia files equals the bit rate of them. The bit rate itself should be found in the file's headers. If not, length of the audio track could be used too. (Filesize / Track Length = Bit Rate) These things would be easy if I would have these files locally, but I would like to fetch this information over HTTP and determine which file has the highest quality. Can I get an audio track's length out of HTTP headers? If not, is it possible to fetch only the bits that describes the length/bit rate

Clicks while using LAME to encode from PCM to MP3 in iOS

大兔子大兔子 提交于 2019-12-05 23:24:11
I am not the first to have this type of issue, however, I have no been able to solve it. I am encoding a LinearPCM to MP3 in iOS. It is working though I am experiencing clicks between each buffer. memset(&mEncodedBuffer, 0, sizeof(mEncodedBuffer)); int encodedBytes = lame_encode_buffer(gfp, (short*)inBuffer->mAudioData, NULL, inNumberPacketDescriptions, mEncodedBuffer, MP3_BUFFER_SIZE); NSData* data = [NSData dataWithBytes:mEncodedBuffer length:encodedBytes]; Then, I do the following with the buffer: AudioQueueEnqueueBuffer(vc.recordState.queue, inBuffer, 0, NULL); I have tried adding the

Streaming audio/radio in Java?

大城市里の小女人 提交于 2019-12-05 22:14:15
I've been looking around the entire web, and tried a bunch of different stuff, but I can't figure out how to play streaming audio in java - which is crucial for the application Iam developing now. It's a radio. I've already written it for the web, but I want a desktop version, and I though java might be the way to go. Streams look like this (mostly MP3s): http://lyd.nrk.no/nrk_radio_mp3_mp3_h (example from NRK MP3 - a radio channel in Norway). So where should I go from here? I've tried both JMF, FMJ and a lot of other stuff. I just want to stream audio.. I appreciate all answers, please help

cut exact time range from mp3/ogg

妖精的绣舞 提交于 2019-12-05 20:51:51
I have a heap of audio files on a CDN. Those are mp3's and ogg vorbises, in parallel. Those files are each worth about one hour of playback. I need to extract arbitrary parts from those files: I am given a filename (I can choose if I use the mp3 or ogg version) and two timestamps and I need the audio exactly between the given time positions. I don't want to download the whole file, so I think of using the Range http header. I have complete control over the audio files, so I encoded them in fixed bitrate, to be able to estimate which bytes I should reach for. However, both formats use frames

MP3 byte array - convert to WAV and navigate to time index?

拈花ヽ惹草 提交于 2019-12-05 18:25:33
I have a byte array containing an MP3 stream. Is it correct to assume that this stream would have to be further decoded if I want to be able convert to a WAV? In its current byte state, is it possible to do basic functionality such as get/set position (time-wise)? Yeah, MP3 files are very different from WAV files. WAV files contain raw audio data in the form of samples from beginning to end to paint the waveform of the output, the same way a bitmap file contains raw data about pixels from left to right, top to bottom. You can think of a WAV file as a bitmap picture of sound waves -- but rather

Stream data (such as music) using PHP (or another language)

馋奶兔 提交于 2019-12-05 18:18:37
For years, I've been investigating how to create music streams from my computer. I've seen programs, but anything useful I've seen is Windows only (I use a Mac). Eventually, I got interested in how streams work. Is there any way I could create my own stream, possibly using socket functions in PHP ? Is there a PHP library for this? Take a look at Ampache . It is a Web-based Open Source Audio file manager. It is implemented with MySQL, and PHP. It allows you to view, edit, and play your audio files via the web. In the end it all boils down to the protocol you'd want to use. Shoutcast IMHO is

android fastest way to decode mp3 to pcm data

徘徊边缘 提交于 2019-12-05 16:15:48
in my app i need to decode an mp3 file into a pcm buffer. that's a lot of data so i downsample it to mono 22050Hz as i read and decode it. at the moment i'm using javazoom jlayer decoder http://www.javazoom.net/javalayer/javalayer.html its working but its slow, 30secs to decode a 3min song in run mode, ages in debug mode. on my windows machine using libmpg i can do that in about 1 second. is there a faster way that anyone knows for sure is faster? i don't want to waste time implementing another method if its not significantly faster. thanks. by the way, in my app, i need the whole thing

Android protect mp3 file form being shared, but still playable

青春壹個敷衍的年華 提交于 2019-12-05 15:40:12
how can I protect an mp3 file I downloaded from my server (legal content owner) from being forwarded via email, Bluetooth etc. I wish the file be playable on device media player so i will send it to ContentResolver. I have seen this on some official apps for our region, but i do not know how to flag/mark my files as non share-able. Thank You! how can I protect an mp3 file I downloaded from my server (legal content owner) from being forwarded via email, Bluetooth etc. Technically, you can't, unless you implement your own MP3 player app and store it in there. If you are relying upon other apps