mp3

HTML5 audio - currentTime attribute inaccurate?

狂风中的少年 提交于 2020-01-10 11:13:02
问题 I'm playing around a bit with the HTML5 <audio> tag and I noticed some strange behaviour that has to do with the currentTime attribute. I wanted to have a local audio file played and let the timeupdate event detect when it finishes by comparing the currentTime attribute to the duration attribute. This actually works pretty fine if I let the song play from the beginning to the end - the end of the song is determined correctly. However, changing the currentTime manually (either directly through

Unity处理MP3流播放

拟墨画扇 提交于 2020-01-10 08:19:46
Unity处理MP3流播放 PCMReaderCallback回调 Unity音频数据是通过AudioClip去处理的,它提供了PCMReaderCallback回调,用于加载流音频数据。它的声明如下: public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool stream, AudioClip.PCMReaderCallback pcmreadercallback); public delegate void PCMReaderCallback(float[] data); PCMReaderCallback中的PCM指的是音频数据格式,下面会讲到。在stream模式下,lengthSamples表示播放时,每次循环处理的sample数,这会影响到回调参数data的大小。回调函数参数data就是需要填充的音频数据,它的格式是PCM,data的长度可以由lengthSamples * channels计算出来。 值得注意的是,PCMReaderCallback执行环境不一定,它是由Unity回调的,可能是主线程,也可能是子线程。所以当它卡住的时候,可能会卡掉整个应用。 PCM格式 PCM是Pulse Code Modulation的缩写

Ubuntu上用网易云音乐乱码(亲测可用)

大憨熊 提交于 2020-01-10 06:47:06
使用Ubuntu听音乐的时候,播放列表总显示为乱码,这点非常不爽。于是上网搜索了下,终于找到了解决的办法。 简单的方法就是将MP3标签转换为Unicode编码,要使用到python-mutagen,在新立得软件管理中可以直接找到,也可以用以下的命令进行安装: sudo apt-get install python-mutagen 使用方法: 在终端中进入音乐文件所在的目录,执行: mid3iconv -e gbk *.mp3 如果有子目录的话,执行: find . -iname “*.mp3″ -execdir mid3iconv -e gbk {} ; 或“mid3iconv -e GBK / .mp3” 注:1.-e gbk参数是代表把 GBK 编码的标签转换为 Unicode 编码,本身是 Unicode 编码的就不转换。如果需要转换其他编码的文件可以自行修改,如改为 Big5。 2.绝大多数能找到的 mp3 标签都是以 GBK/GB18030 编码,使用 -e gbk 来处理就够了,当然你也可以使用 -e gb18030 来处理。 3.它会同时用 Unicode 编码填满 D3v1, ID3v2, APEv2 标签,但是 ID3v1 又不支持中文的 Unicode 编码,所以转换后的 ID3v1 标签全是问号。所以最好加上 –remove-v1 参数,转换后删除 ID3v1

Read part of a file in PHP

假如想象 提交于 2020-01-10 05:55:06
问题 I would like to read the last 1 megabyte of a MP3 file and calculate SHA1 checksum for just that part of the file. The reason that I would want this is that when I'm looking for duplicate MP3's, the header info (song title, album etc.) can differ even though it's the exakt same audio file, so I figured I would be better of to checksum a part of the file at the end instead of the whole one. Is there an efficient way of doing this? 回答1: You'd have to use the c wrappers for file manipulation:

How to play an mp3 file in java

こ雲淡風輕ζ 提交于 2020-01-10 04:17:07
问题 I am trying to play a song (mp3 file) in java. I have been looking around for a few hours now and none of the ways I found worked properly. public void play() { String song = "song.mp3"; Media track = new Media(song); MediaPlayer mediaPlayer = new MediaPlayer(track); mediaPlayer.play(); } I have tried doing that but it gives me errors. I have imported JMF and JLayer . I have also read other questions that are like this one on this forum and none of them have helped me. I just need a hand to

converting pcm file to mp3 using liblame in android

旧时模样 提交于 2020-01-10 03:07:08
问题 I am using SimpleLameLibForAndroid to convert a pcm file that created using AudioRecord class in android,to mp3. I read the pcm file and encoded it into mp3 and then I write it in the file. the result mp3 file but is not correct and it has a lot of noise on it and really hard to understand that it was recorded pcm file. these are recorded audio specifications(pcm file): private static final int RECORDER_SAMPLERATE = 8000; private static final int RECORDER_CHANNELS = AudioFormat.CHANNEL_IN

Is it possible to load a compressed audio file directly into a buffer, without conversion?

跟風遠走 提交于 2020-01-07 07:20:07
问题 I am developing an iOS app that must handle several stereo audio files (ranging from a few seconds to four minutes in duration) at once, playing up to three back simultaneously, synched through a Multi-Channel-Mixer-based AUGraph. My audio files are compressed – either as MP3, AAC or CAF – but when they are loaded into buffers are converted into the 32-bit AudioUnitSampleType format (my code is based on Apple's iPhoneMultichannelMixerTest). Needless to say, with such large buffers, app memory

Running dir2ogg from php script

笑着哭i 提交于 2020-01-06 08:05:42
问题 I am trying to write a php script where it will take an uploaded mp3 file and automatically create a copy of it in ogg format. My idea is to use exec() or shell_exec() to run dir2ogg from php. This is my code: $command = 'dir2ogg /var/www/bais-mordechai-laravel/public/uploads/"'.$filename.'"'; $output = shell_exec($command); The output that I am getting from this is only the first line of the expected output: dir2ogg 0.11.8 (2009-08-04), converts audio files into ogg vorbis. When I run this

Running dir2ogg from php script

我与影子孤独终老i 提交于 2020-01-06 08:05:29
问题 I am trying to write a php script where it will take an uploaded mp3 file and automatically create a copy of it in ogg format. My idea is to use exec() or shell_exec() to run dir2ogg from php. This is my code: $command = 'dir2ogg /var/www/bais-mordechai-laravel/public/uploads/"'.$filename.'"'; $output = shell_exec($command); The output that I am getting from this is only the first line of the expected output: dir2ogg 0.11.8 (2009-08-04), converts audio files into ogg vorbis. When I run this

why do i get java.lang.IllegalArgumentException: No line matching interface SourceDataLine supporting format MPEG1L3 44100.0 …

▼魔方 西西 提交于 2020-01-06 02:51:09
问题 I have set mp3plugin.jar in the run time libraries needed in my netbeans project .But still i get the above exception when i try to play mp3 file .What is the reason for this : import java.io.File; import java.io.IOException; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.SourceDataLine; public class