mp3

How to convert wav file to mp3 in memory?

烂漫一生 提交于 2021-02-07 09:12:49
问题 I have an application written using c# on the top of Asp.Net MVC 5 framework. My objective is to make a call to 3rd party service to download a wave file. Then I want to convert this file into mp3. Finally, I want to return the mp3 file as (byte[]) to allow the user to download it directly from memory. Here is how my code will end up which allow the user to download the converted file from the memory public ActionResult Download(int? id) { // Download and convert the file // the variable

Can't give metadata of comment to MP3 file using ffmpeg

拥有回忆 提交于 2021-02-05 08:47:26
问题 I want to covert a AAC to MP3 and give metadata of comment to the MP3 file using ffmpeg. But -metadata comment doesn't work and ffmpeg doesn't return any error. My code is ffmpeg -i "test.aac" -ab 128k -metadata comment='this is test' "test.mp3" I tried -metadata description='this is test' and also update ffmpeg. Other function such as -metadata artist and -metadata album works well. What's wrong with this code? Output Stream mapping: Stream #0:0 -> #0:0 (aac (native) -> mp3 (libmp3lame))

Error when downloading a file with url into internal storage Android Studio

戏子无情 提交于 2021-01-29 18:23:06
问题 I'm trying to download a mp3 music into internal storage, but conexion.connect(); seems like it have a error and end up going to the Exception. Here is my code: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { String filePath = getExternalCacheDir().getAbsolutePath(); filePath += "/audiotest.mp3"; int count; try { URL url = new URL("my_url_to_download"); URLConnection conexion = url.openConnection(); conexion.connect(); /

How to stream MP3 chunks given a NumPy array in Python?

让人想犯罪 __ 提交于 2021-01-29 14:41:44
问题 I'm struggling to find a solution for streaming synthesized audio from a Python server. The synthesized audio is incrementally generated and returned as a np.float32 NumPy array. It then needs to be transformed from a NumPy array into an MP3 chunk. Finally, the MP3 chunk is served via flask . Here is some pseudo-code: import numpy from flask import Flask from flask import Response app = Flask(__name__) sample_rate = 24000 def pcm_to_mp3(): raise NotImplementedError() def get_synthetic_audio()

ffmpeg being inprecise when trimming mp3 files

▼魔方 西西 提交于 2021-01-29 10:32:04
问题 I want to use ffmpeg to trim some mp3s without re-encoding. The command I used was ffmpeg -i "inputfile.mp3" -t 00:00:12.414 -c copy out.mp3 However, out.mp3 has a length of 12.460s, and when I load the file in Audacity I can see that it was cut at the wrong spot, and not at 12.414s. Why is this? I googled a bit and tried some other commands like ffmpeg -i "inputfile.mp3" -ss 0 -to 00:00:12.414 -c copy out.mp3 (which interestingly results in a different length of 12.434s) but could never get

Detect Matching Sounds in Audio Stream

时光总嘲笑我的痴心妄想 提交于 2021-01-29 10:26:37
问题 I'd like to compare the audio output from a PC game to known audio files (*.mp3 for example). If the audio stream contains the recorded audio, I'd like to measure the amplitude of the matching audio in the left/right stereo channels. The goal is to determine the direction and distance of the sound (footsteps/gunshots). It would also be a bonus to amplify the matching audio without affecting the rest of the audio stream. Are there any open-source projects that would be a good reference? Any

ID3V2.3, ETCO Frame Event Format Clarification

放肆的年华 提交于 2021-01-29 09:49:13
问题 According to the informal standard, an ETCO frame is the frame header (ten bytes), followed by a time stamp format (one byte). This is then followed by a series of events of the form "Type of Event, Time Stamp" ( Type of Event is one byte, while Time Stamp is five bytes per event). How can someone figure out how many events there are? Would a program need to use the size field of the frame header? If all events are five bytes in length, what's the purpose of the 0xFF event, whose purpose is

Formula from mp3 Frame Length

╄→尐↘猪︶ㄣ 提交于 2021-01-29 08:50:51
问题 I am working on an mp3 decoder, the formula to determine the length, in bytes, of an mp3 frame is FrameSize = 144 * BitRate / (SampleRate + Padding) I can't find anywhere that explains what the '144' represents. Does anyone know? 回答1: The 144 represents total bytes-per-frame . MP3 files are generally encoded as MPEG-1 Layer 3. There are 1152 samples per frame in type Layer 3. 1152 samples / 8 bits-per-byte = 144 bytes total. Taking the formula for frame size (in bytes): FrameSize = 144 *

Is it possible to restream an internet radio using PHP? (PHP guru needed)

白昼怎懂夜的黑 提交于 2021-01-27 11:44:44
问题 Is it possible to restream an internet radio using PHP? Radio is available at port 8000. I would like to use my webserver and "transmit" the radio stream to port 80. Is it possible? I have already been googling it around and I found http://support.spacialnet.com/forums/viewtopic.php?f=13&t=16858&start=15 but it doesn't work for me. It does actually work. Before I just forget to change MIME type of the stream. I customized solution from previously mentioned URL (http://support.spacialnet.com

TagLib sharp not editing artist

自古美人都是妖i 提交于 2021-01-27 05:46:23
问题 I'm trying to save new artist and title id3 tags into tracks. Loading tags from tracks working good, also editing title for track is working fine. But when i try to edit performer (artist) it didn't change anything. Here is the code public void renameID3(string artist,string title) { using (TagLib.File f = TagLib.File.Create(FInfo.FullName)) { f.Tag.Artists[0] = artist; //Both of them are not ... f.Tag.Performers[0] = artist; //working f.Tag.Title = title; //This works fine f.Save(); } } Plus