audio.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 10 Feb 2018 01:36:16 +0200
changeset 2229 1a0b6597e594
parent 2228 837f1337c59b
permissions -rw-r--r--
Mark block quot in HTMLe.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1192
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
.. -*- coding: utf-8; -*-
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
========
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
 Audio.
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
========
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
.. contents::
1905
fba288d59662 Include only local subsections into TOC. This prevent duplication of
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1657
diff changeset
     7
   :local:
1192
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
Sound in Debian.
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
================
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2056
diff changeset
    12
* http://wiki.debian.org/ALSA
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2056
diff changeset
    13
* http://wiki.debian.org/SoundFAQ
1192
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
1350
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    15
Test speaker and microphone.
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    16
============================
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    17
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    18
To configure audio devices::
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    19
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    20
  $ alsamixer
1610
e885dae79517 pavucontrol
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1600
diff changeset
    21
  $ pavucontrol
1350
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    22
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    23
To hier voice from mic in speaker::
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    24
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    25
  $ arecord | aplay
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    26
  $ arecord -f cd | aplay -f cd
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    27
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    28
To list of available devices::
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    29
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    30
  $ aplay -l
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    31
  $ aplay -L
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    32
  $ arecord -l
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    33
  $ arecord -L
69dff9ee90aa Test speaker and microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    34
1600
391d3e19d99b pactl list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1350
diff changeset
    35
  $ pactl list
391d3e19d99b pactl list
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1350
diff changeset
    36
1630
e3bffa18d09d Play simple sounds.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1610
diff changeset
    37
Play simple sounds.
e3bffa18d09d Play simple sounds.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1610
diff changeset
    38
===================
e3bffa18d09d Play simple sounds.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1610
diff changeset
    39
::
e3bffa18d09d Play simple sounds.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1610
diff changeset
    40
e3bffa18d09d Play simple sounds.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1610
diff changeset
    41
  $ sudo apt-get install sox
e3bffa18d09d Play simple sounds.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1610
diff changeset
    42
  $ play -n synth sin 440 vol -40dB
e3bffa18d09d Play simple sounds.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1610
diff changeset
    43
  $ play -n synth 10 square 100-10000 synth sin fmod 100 vol -40dB
e3bffa18d09d Play simple sounds.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1610
diff changeset
    44
2054
9bfc4f8cc136 Record from microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2004
diff changeset
    45
Record from microphone
9bfc4f8cc136 Record from microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2004
diff changeset
    46
======================
9bfc4f8cc136 Record from microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2004
diff changeset
    47
::
9bfc4f8cc136 Record from microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2004
diff changeset
    48
2056
d9db33201998 Record from microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2055
diff changeset
    49
  $ arecord out.wav
2054
9bfc4f8cc136 Record from microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2004
diff changeset
    50
  $ arecord -f cd -t raw | oggenc -r -o out.ogg -
2055
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2054
diff changeset
    51
  $ arecord -f cd -t raw | lame -r - out.mp3
2056
d9db33201998 Record from microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2055
diff changeset
    52
  $ sox -t alsa default out.wav
d9db33201998 Record from microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2055
diff changeset
    53
  $ audacity &
2054
9bfc4f8cc136 Record from microphone.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2004
diff changeset
    54
1657
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    55
Check HDA params.
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    56
=================
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    57
::
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    58
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    59
  $ sudo apt-get install alsa-tools-gui
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    60
  $ hdajackretask
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    61
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    62
See also:
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    63
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2056
diff changeset
    64
http://www.alsa-project.org/main/index.php/HDA_Analyzer
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2056
diff changeset
    65
  provides a graphical interface to access the raw HD-audio control
1657
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    66
1192
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    67
Suitable convertors?
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    68
====================
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    69
::
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    70
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    71
  $ sudo apt-get install ffmpeg
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    72
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    73
or::
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    74
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    75
  $ sudo apt-get install sox
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    76
1630
e3bffa18d09d Play simple sounds.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1610
diff changeset
    77
List of sox supported format: See sox(1).
1192
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    78
1630
e3bffa18d09d Play simple sounds.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1610
diff changeset
    79
List of ffmpeg supported format::
1192
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    80
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    81
  $ ffmpeg -formats
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    83
How convert amr to ogg/mp3?
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    84
===========================
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    85
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    86
TODO
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    87
2004
a2d6d17dfdbd Remove duplicated file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1995
diff changeset
    88
Converting music formats
a2d6d17dfdbd Remove duplicated file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1995
diff changeset
    89
========================
1192
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    90
::
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    91
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    92
  $ sox in.mp3 out.ogg
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    93
  $ sox in.ogg out.wav
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    94
  ... etc
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    95
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    96
How convert flac to mp3?
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    97
========================
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    98
::
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    99
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   100
  $ flac -c -d $file.flac | lame -m j -q 0 -V 0 -s 44.1 - $file.mp3
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   101
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   102
How convert wma to mp3?
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   103
=======================
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   104
::
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   105
1995
b09608bae2a0 How convert wma to mp3?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   106
  $ mplayer -vo null -vc dummy -af resample=44100 -ao pcm:file=$file.wav $file.wma
b09608bae2a0 How convert wma to mp3?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   107
  $ lame -m s $file.wav -o "$file.mp3
b09608bae2a0 How convert wma to mp3?
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   108
  $ rm $file.wav
1192
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   109
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   110
How convert m4a to mp3?
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   111
=======================
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   112
::
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   113
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   114
  $ faad -o - $file.m4a | lame -V 0 - $file.mp3
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   115
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   116
How split mp3/ogg files?
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   117
========================
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   118
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   119
Split mp3 and ogg files::
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   120
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   121
  $ mp3splt
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   122
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2056
diff changeset
   123
See:
1192
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   124
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2056
diff changeset
   125
http://mp3splt.sourceforge.net/mp3splt_page/home.php
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2056
diff changeset
   126
   Home page.