⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mp3_to_dl

📁 一款MP3 Player Firmware 的原代码,非常有参考价值
💻
字号:
#! /usr/bin/perl# convert a MP3 file into a text-only format that may be download# to the MP3 player's memory-only playback program.  The format is# just uuencoded data in 4096 byte blocks, with the word "end" after# the last line.$ARGV[0] && $ARGV[1] || die "Usage: mp3_to_dl input.mp3 output.txt\n";open(FIN, "$ARGV[0]") || die "Unable to read $ARGV[0]\n";open(FOUT, ">$ARGV[1]") || die "Unable to write $ARGV[1]\n";$len = -s $ARGV[0];$block = 30;while ($len > 0) {	$num = 4096 - read(FIN, $data, 4096);	$data .= pack("x$num") if $num > 0;	print FOUT pack('u', $data);	$len -= 4096;}print FOUT "end\n";close FIN;close FOUT;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -