Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >mpg123学习进阶2------mp123的使用总结

mpg123学习进阶2------mp123的使用总结

作者头像
用户4148957
发布于 2022-06-14 00:18:03
发布于 2022-06-14 00:18:03
1.3K0
举报
文章被收录于专栏:C/C++与音视频C/C++与音视频

mp123  移植总结 1../configure 选项  配置环境,产生makefile。这里是在pc默认为gcc和oss架构驱动,如果是其他平台或其他架构驱动,要修改makefile或./configure 在选项中传入 2.sudo make  在src目录下产生一个mpg123镜像就是一个可以执行的镜像。 3.sudo make install 可以将mp123生成的动态库安装到相应的目录下。默认在/usr/local/lib.可以在./configure是通过--prefix来修改路径 4.跑mp123demo   ./mpg123 1.mp3 2.mp3 3.mp3    ./mpg123 http//192.168.1.108/myserver/love.mp3   注意mpg123 除了支持多列表本地播放,还支持网络播放,还支持wav等格式输出。   使用方法;   -v 打印播放时间                             -q  不打印标题,默认是打印的   -t  测试程序,没有输出                     -s  解码后的pcm输出到屏幕(默认是送到声卡驱动播放)   -w  将播放的pcm打包成wav输出,而不是播放   -k n skip多少帧播放,用于seek用              -n n  只解码多少帧   -c 测试过,没看出来什么效果                  -y 显示同步错误   -b 改变输出buf的大小(不常用)               -f  10000 改变声音系数,可以用来调节声音大小    -os,-ol,-oh  output to built-in speaker,line-out connector,headphones    -d k  每隔k帧播放一次,用于跳帧,实际当中可以用来快进快退       -C  产生热键校园: s 应用pause ,pp用于换房播放 q用于退出    详细使用说明:    usage: lt-mpg123 [option(s)] [file(s) | URL(s) | -] supported options [defaults in brackets]:    -v    increase verbosity level       -q    quiet (don't print title)    -t    testmode (no output)           -s    write to stdout    -w <filename> write Output as WAV file    -k n  skip first n frames [0]        -n n  decode only n frames [all]    -c    check range violations         -y    DISABLE resync on errors    -b n  output buffer: n Kbytes [0]    -f n  change scalefactor [32768]    -r n  set/force samplerate [auto]    -os,-ol,-oh  output to built-in speaker,line-out connector,headphones                                         -a d  set audio device    -2    downsample 1:2 (22 kHz)        -4    downsample 1:4 (11 kHz)    -d n  play every n'th frame only     -h n  play every frame n times    -0    decode channel 0 (left) only   -1    decode channel 1 (right) only    -m    mix both channels (mono)       -p p  use HTTP proxy p [$HTTP_PROXY]    -@ f  read filenames/URLs from f     -T get realtime priority    -z    shuffle play (with wildcards)  -Z    random play    -u a  HTTP authentication string     -E f  Equalizer, data from file    -C    enable control keys            --no-gapless  not skip junk/padding in mp3s    -?    this help                      --version  print name + version

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2014-02-23,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
mpg123 学习进阶1
It can play MPEG1.0/2.0/2.5 layer I, II, II(1, 2, 3;-) files (VBR files are fine, too) and produce output on a number ofdifferent ways: raw data to stdout and different sound systems depending onyour platform (see INSTALL).
用户4148957
2022/06/14
4590
libmad学习进阶6------madplay的使用 总结
1.先安装 1.madplay-0.15.2b.tar.gz 2.libmad-0.15.1b.tar.gz 3 libid3tag-0.15.1b.tar.gz  方法是:./configure  sudo make sudo make install prefix = /usr/local  中prefix 为make install的安装目录,默认在/usr/loacl 如果希望安装到其他目录 ./configure --prefix=/安装目录路径 4.执行madplay 播放mp3 先加载动态库 :如 export LD_LIBRARY_PATH=/usr/local/lib 播放mp3     ./madplay 1.mp3 2.mp3 3.mp3  madpay功能很强求,可以实现多个节目循环播放,快进拖动播放,暂停,恢复,支持wav等格式输出等。 目前madplay还不支持网络播放.不过mp123支持网络播放。 madplay使用方法: 传入打印既可以使用短传入(-n ),也可以使用长传入(--abc),二者等效,下面只讲短传入 -v  获取播放时间 -q  不存在任何打印,但现实警告 -Q  不存在任何打印 --downsample  只采用一半数据 -i  忽略CRC校验错误 -o PATH/xx.wav 可以用来转码,将mp3转为wav   也可以是其他格式,见说明;.raw  表示是元素pcm,.hex等 -a 开启衰减音量 ,增加音量,衰减系统为-175~+18    (当然通过键盘+ —也可以调整音量) -A 同-a -1 -2 -m -S 分别指左声道,右声道,双声道,立体声 -s  用于seek播放 如:0:1:20:11 ,seek到1小时,2分钟,11秒时开始播放 -t  用于播放时间现在  0:1:20:11 ,播放到1小时,2分钟,11秒时就停止 -z  用于随机播放列表 -r, --repeat[=MAX]   循环播放无限次或Max次  --tty-control            enable keyboard controls  默认是使能热键 --no-tty-control         disable keyboard controls 热键使用 下一首歌曲; f,或ctrl+n 或者> 上一首歌曲  b ,或ctrl+p 或者< 退出:q, Q,获取ctrl+c 获取播放状态信息: i  ? 调节音量: - + _ = 暂停恢复:p 停止:s Usage: ./madplay [OPTIONS] FILE [...] Decode and play MPEG audio FILE(s). Verbosity:   -v, --verbose                show status while decoding   -q, --quiet                  be quiet but show warnings   -Q, --very-quiet             be quiet and do not show warnings       --display-time=MODE      use default verbose time display MODE                                  (remaining, current, overall) Decoding:       --downsample             reduce sample rate 2:1   -i, --ignore-crc             ignore CRC errors       --ancillary-output=PATH  write ancillary data to PATH Audio output:   -o, --output=[TYPE:]PATH     write output to PATH with format TYPE (below)   -b, --bit-depth=DEPTH        request DEPTH bits per sample   -R, --sample-rate=HERTZ      request HERTZ samples per second   -d, --no-dither              do not dither
用户4148957
2022/06/14
1.5K0
Mpg123源代码详解
Mpg123与libmad一样,支持mpeg1,2,2.5音频解码。目前来看mpg123比libmad支持了网络播放功能。而且libmad基本上开源社区在2005年左右,基本停止更新,mpg123至今还在持续更新源代码。 1.      mpg123是如何支持某种音频驱动的? Mpg123跟liamad一样,向下也支持oss,alsa,win32等驱动,是如何支持的。Libmad是修改config文件的宏来完成,而mpg123是修改makefile或者configure来完成 ALSA_LIBS =-las
xiangzhihong
2018/02/05
1.2K0
libmad学习进阶4 -----基于atlas音频驱动架构的MP3播放器
 /*modify by hfl 20140216*/ #define ALSA_PCM_NEW_HW_PARAMS_API # include <stdio.h> # include <unistd.h> # include <sys/stat.h> # include <sys/mman.h> # include "mad.h" #include<sys/types.h> #include<sys/stat.h> #include<fcntl.h> #include<stdlib.h> #include <sys/ioctl.h> #include <sys/soundcard.h> #include <alsa/asoundlib.h> /*  * This is perhaps the simplest example use of the MAD high-level API.  * Standard input is mapped into memory via mmap(), then the high-level API  * is invoked with three callbacks: input, output, and error. The output  * callback converts MAD's high-resolution PCM samples to 16 bits, then  * writes them to standard output in little-endian, stereo-interleaved  * format.  */  //#define printf     static Get_file_length(char *PATH); static int init_dsp(); static int Uninit_dsp(); static int decode(unsigned char const *, unsigned long); static enum mad_flow outputplay(void *data,     struct mad_header const *header,     struct mad_pcm *pcm); int main(int argc, char *argv[]) { printf("The main is start!\n");   struct stat stat;   void *fdm;   int  fd;   //char buffer1[80000];   printf("###The input file is %s  ! the arc=%d###\n",argv[1],argc);   if (argc == 1)    {    printf("The argc is wrong!\n");     return 1;  } #if 0   if (fstat(STDIN_FILENO, &stat) == -1 ||       stat.st_size == 0)     return 2; #endif  fd =open(argv[1],O_RDWR); if(-1==fd) {    printf("sorry,The file open is faild!\n"); } else {  printf("The file open is sucessed!\n"); } //read(fd,buffer1,sizeof(buffer1)); //printf("%s", buffer1); stat.st_size = Get_file_length(argv[1]); printf("The file size is %d\n",stat.st_size ); printf("The Map is begin ok!\n"); fdm = mmap(0, stat.st_size, PROT_READ, MAP_SHARED, fd, 0);   if (fdm == MAP_FAILED) { printf("mmap is failed\n");     return 3; }   decode(fdm, stat.st_size);   if (munmap(fdm, stat.st
用户4148957
2022/06/14
8280
让终端支持播放mp3,移植mp3解码库libmad和madplay到嵌入式linux
MAD (libmad)是一个开源的高精度 MPEG 音频解码库,支持 MPEG-1(Layer I, Layer II 和 LayerIII(也就是 MP3)。LIBMAD 提供 24 -bit 的 PCM 输出,完全是定点计算,非常适合没有浮点支持的平台上使用。使用 libmad 提供的一系列 API,就可以非常简单地实现 MP3 数据解码工作。
杨永贞
2020/08/04
2.8K0
USF MSDS501 计算数据科学中
本实验的目标是让您感到惊讶,您可以使用 Python 处理一些音频文件。您将无法获得所有详细信息,但您可以剪切并粘贴此实验来启动 Python 会话。作为次要目标,您将习惯于安装 Python 包和命令行工具。
py3study
2020/01/03
1.5K0
python语音智能对话聊天机器人,linux&&树莓派双平台兼容
项目简介:运用百度语音进行声音转中文的识别与合成,智能对话使用图灵机器人,录音则,linux端用pythonaudio 模块.树莓派端因为pythonaudio不兼容问题,因此用arecord进行录音.最终代码约150行.代码发布在github上.https://github.com/luyishisi/python_yuyinduihua
十四君
2019/11/28
6.1K0
Python中的av入门
在Python中,av是一个强大的多媒体处理库,提供了音频和视频的编码、解码、剪辑、合并等功能。本文将介绍av库的安装和基本用法,以帮助你快速入门。
大盘鸡拌面
2023/10/17
8630
用ffmpeg 提取MP3
:现在有个视频video.avi,有个音频 audio.mp3,将其合并成output.avi
py3study
2020/01/07
4.9K0
libmad学习进阶3-----基于oss音频驱动架构的一个mp3播放器
以上就是通过libmad将mp3先解码成pcm,然后将pcm直接扔到/ dev/dsp音频设备中,但dsp音频设备属于oss架构,已经逐渐被alsa驱动取代,后续会介绍基于alsa驱动架构的mp3播放器
用户4148957
2022/06/14
7120
语音对话机器人
那么它一定得回复我们,对吧。为了能够智能点,我们就用到了图灵得接口图灵真的非常好用能够 查天气语音**讲故事**讲笑话 下面附上第三步的代码
大发明家
2021/12/06
4.4K0
Linux下使用ffmpeg播放mp3/aac/wav文件的音乐播放器应用
使用ffmpeg实现一个播放器?是不是没什么新意,不过一直使用ffmpeg程序,还没有用ffmpeg代码接口实现播放器,并且还需要使用linux的alsa接口播放出声音,所以做出来还是觉得有点意思;
呱牛笔记
2023/05/02
3.6K0
Linux下使用ffmpeg播放mp3/aac/wav文件的音乐播放器应用
FFmpeg推流命令总结
今天考虑一个mcu混合的实现,也就是接收多路过来的rtp流,然后转发出去一路的rtmp流,使用ffmpeg测试做的记录,刚开始一直通过ffmpeg推送的文件流不能满足要求,还是对参数配置不熟悉;
呱牛笔记
2023/05/02
6.8K0
FFmpeg推流命令总结
libmad学习进阶2----利用libmad将mp3转码成pcm
# include <stdio.h> # include <unistd.h> # include <sys/stat.h> # include <sys/mman.h> # include "mad.h" #include<sys/types.h> #include<sys/stat.h> #include<fcntl.h> #include<stdlib.h> /* * This is perhaps the simplest example use of the MAD high-level API. * Standard input is mapped into memory via mmap(), then the high-level API * is invoked with three callbacks: input, output, and error. The output * callback converts MAD's high-resolution PCM samples to 16 bits, then * writes them to standard output in little-endian, stereo-interleaved * format. */ #define printf static Get_file_length(char *PATH); static int decode(unsigned char const *, unsigned long); int main(int argc, char *argv[]) { printf("The main is start!\n"); struct stat stat; void *fdm; int fd; //char buffer1[80000]; printf("###The input file is %s ! the arc=%d###\n",argv[1],argc); if (argc == 1) { printf("The argc is wrong!\n"); return 1; } #if 0 if (fstat(STDIN_FILENO, &stat) == -1 || stat.st_size == 0) return 2; #endif fd =open(argv[1],O_RDWR); if(-1==fd) { printf("sorry,The file open is faild!\n"); } else { printf("The file open is sucessed!\n"); } //read(fd,buffer1,sizeof(buffer1)); //printf("%s", buffer1); stat.st_size = Get_file_length(argv[1]); printf("The file size is %d\n",stat.st_size ); printf("The Map is begin!\n"); fdm = mmap(0, stat.st_size, PROT_READ, MAP_SHARED, fd, 0); if (fdm == MAP_FAILED) { printf("mmap is failed\n"); return 3; } decode(fdm, stat.st_size); if (munmap(fdm, stat.st_size) == -1) return 4; return 0; } /* * This is a private message structure. A generic pointer to this structure * is passed to each of the callback functions. Put here any data you need * to access from within the callbacks. */ struct buffer { unsigned char const *start; unsigned long length; }; /* * This is the input callback. The purpose of this callback is to
用户4148957
2022/06/14
7090
FFMPEG音视频开发指南(一)
FFmpeg是一款开源软件,用于生成处理多媒体数据的各类库和程序。FFmpeg可以转码、处理视频和图 片(调整视频、图片大小,去噪等)、打包、传输及播放视频。作为最受欢迎的视频和图像处理软件, 早已经被各行各业的不同公司所广泛使用。
DS小龙哥
2022/10/06
3.3K0
FFMPEG音视频开发指南(一)
FFmpeg 入门
下图是另一个例子: ffplay -f lavfi -i rgbtestsrc -vf "split[a][b];[a]pad=2*iw[1];[b]vflip[2];[1][2]overlay=w"
王磊-字节跳动
2021/06/27
4.7K0
【FFmpeg】ffmpeg 命令行参数 ③ ( ffmpeg 音频参数解析 | 设置音频帧数 | 设置音频码率 | 设置音频采样率 | 设置音频通道数 | 设置音频编解码器 | 设置音频过滤器 )
在 ffmpeg 命令中 , -aframes 参数用于设置 要输出的 音频帧 帧数 , 通过该参数 设置 一个 指定的 音频帧数 , 输出完 该 指定音频帧数 的 音频帧 之后 , ffmpeg 将会停止处理音频流 , 通过该参数 可以 精确控制音频输出长度 ;
韩曙亮
2024/02/29
5.2K0
【FFmpeg】ffmpeg 命令行参数 ③ ( ffmpeg 音频参数解析 | 设置音频帧数 | 设置音频码率 | 设置音频采样率 | 设置音频通道数 | 设置音频编解码器 | 设置音频过滤器 )
python根据ip获取地理位置再查询天气情况调百度语音合成朗读
虽然是造轮子,不过还是挺好玩的。主要的困难点再于编码问题。还有一个是部分使用python2.7的代码和python3.4之间的兼容性问题。代码发布在github中。https://github.com/luyishisi/The_python_code/tree/master/automatic_weather
十四君
2019/11/27
1K0
2023-03-30:用Go语言改写FFmpeg示例decode_audio.c,实现高效音频解码。
2023-03-30:用Go语言改写FFmpeg示例decode_audio.c,实现高效音频解码。
福大大架构师每日一题
2023/03/30
4590
2023-03-30:用Go语言改写FFmpeg示例decode_audio.c,实现高效音频解码。
libzplay库
关于MP3文件播放:通常步骤是:获取MP3相关参数 -> 解码-> 相关平台播放音频接口播放声音;
全栈程序员站长
2022/07/25
1.1K0
推荐阅读
相关推荐
mpg123 学习进阶1
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档