简体   繁体   English

如何生成随机的mp3文件?

[英]How can I generate a random mp3 file?

For a personal project I'm trying to write some code that will generate an MP3 file with random noise. 对于个人项目,我正在尝试编写一些代码,以生成带有随机噪声的MP3文件。 I opened up an mp3 file in sublime text and saw that there was a hexadecimal format of thousands of lines of 8 sets of 4 hexidecimal numbers in the file. 我打开了一个高品质的mp3文件,发现文件中有成千上万行的十六进制格式,其中包含8组4个十六进制数字。 Ex... 恩...

4944 3303 0000 0002 0c27 5459 4552 0000 4944 3303 0000 0002 0c27 5459 4552 0000

0005 0000 0032 3031 3454 5055 4200 0000 0005 0000 0032 3031 3454 5055 4200 0000

1f00 0001 fffe 4800 6500 6c00 6c00 6f00 1f00 0001 fffe 4800 6500 6c00 6c00 6f00

So I wrote some code to randomly generate millions of lines of that. 所以我写了一些代码来随机生成数百万行。 The issue is that when I try to open it in itunes or VLC it says the song is zero seconds long. 问题是,当我尝试在iTunes或VLC中打开它时,它说歌曲的长度为零秒。 This makes me think that there is some sort of metadata that the random generation is botching up. 这使我认为随机生成正在破坏某种元数据。 Is there a simple guide on how to make an mp3 file from scratch or a guide on how to make sensible metadata? 是否有关于如何从头开始制作mp3文件的简单指南,或有关如何制作明智的元数据的指南?

如果您查看“ MP3规格”,它会告诉您哪些位代表什么, 也许有些位需要硬编码为特定值?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将mp3音频文件截断30%? - How can I truncate an mp3 audio file by 30%? 如何在 python 中将文本转换为语音(mp3 文件)? - How can I convert text to speech (mp3 file) in python? 如何在网页中流式传输 mp3 文件? - How can I stream an mp3 file in a web page? 如何在 React 中获取 mp3 文件的音频持续时间 - How can i get an audio duration of an mp3 file in React 如何获得 mp3 文件的封面? - how can I get the cover of an mp3 file? 我可以使用Javascript将MP3文件拆分成较小的MP3文件吗? - Can I use Javascript to split up an MP3 file into smaller MP3 files? 如何在 Kotlin 中将 mp3 音频文件转换为 Opus 音频文件? - How can I convert a mp3 audio file to Opus audio file in Kotlin? 我有一个.mp3文件。 如何从C中的其余声音中分离出人声? - I have a .mp3 file. How can I seperate the human voice from the rest of the sound in C? 没有文件扩展名的 MP3 文件如何在 Android 文件应用程序中播放,有什么方法可以在我的 MP3 播放器 Android 应用程序中播放这些文件? - How can MP3 files without a file extension play in the Android files app and is there any way I can play such files in my MP3 player Android app? 如何使用 AVAssetExportSession 导出 AVPlayer 音频 mp3 文件? - How can I export a AVPlayer audio mp3 file using AVAssetExportSession?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM