Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux下音量获取有问题 #31

Closed
Hexcles opened this issue Feb 2, 2015 · 1 comment · Fixed by #34
Closed

Linux下音量获取有问题 #31

Hexcles opened this issue Feb 2, 2015 · 1 comment · Fixed by #34

Comments

@Hexcles
Copy link
Contributor

Hexcles commented Feb 2, 2015

我这儿 amixer get Master 的输出是这样的:

Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 11142 [17%] [on]
  Front Right: Playback 11142 [17%] [on]

所以像现在代码里那样 grep Mono 的话拿到的是空行,不能获取音量。

不知道是有bug还是 amixer 不同版本、平台下的表现不同。前者的话我这儿已经改好了一个版本,可以发个PR上来;后者的话,需要考虑一下更可靠的音量获取方法了。

@taizilongxu
Copy link
Owner

我的这里是在同一行的,看来不同版本不一样啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants