Skip to content

Commit 08c453e

Browse files
committed
* update audio doc
1 parent f7fb259 commit 08c453e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/doc/en/audio/play.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ from maix import audio, time, app
3232
p = audio.Player("/root/output.wav")
3333

3434
p.play()
35-
35+
p.volume(80)
3636
while not app.need_exit():
3737
time.sleep_ms(10)
3838
print("play finish!")
@@ -54,6 +54,7 @@ Steps:
5454
```
5555
- Note that the default sample rate is 48k, the sample format is little-endian format - signed 16-bit, and the sample channel is 1. You can also customise the parameters like this `p = audio.Player(sample_rate=48000, format=audio.Format.FMT_S16_LE, channel = 1)`. So far only tested with sample rate 48000, format `FMT_S16_LE`, and number of sampling channels 1.
5656
- If it is a `.wav` file, the sample rate, sample format and sample channel are automatically obtained.
57+
- `p.volume(80)` set volume value to 80, range is [0~100].
5758

5859
3. Playing audio
5960

docs/doc/zh/audio/play.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ from maix import audio, time, app
3232
p = audio.Player("/root/output.wav")
3333

3434
p.play()
35-
35+
p.volume(80)
3636
while not app.need_exit():
3737
time.sleep_ms(10)
3838
print("play finish!")
@@ -51,10 +51,12 @@ print("play finish!")
5151

5252
```python
5353
p = audio.Player("/root/output.wav")
54+
p.volume(80)
5455
```
5556

5657
- 默认的采样率是48k,采样格式为小端格式-有符号16位,采样通道为1。你也可以像这样自定义参数`p = audio.Player(sample_rate=48000, format=audio.Format.FMT_S16_LE, channel = 1)`。目前只测试过采样率48000,`FMT_S16_LE`格式,和采样通道数为1。
5758
- 如果是`.wav`文件,则会自动获取采样率、采样格式和采样通道。
59+
- `p.volume(80)`设置音量为80,范围为[0~100]
5860

5961
3. 播放音频
6062

0 commit comments

Comments
 (0)