audio.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 03 Oct 2015 18:29:10 +0300
changeset 1765 2132765de2f4
parent 1657 b5bc03faed27
child 1905 fba288d59662
permissions -rw-r--r--
Cellular automaton.
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; -*-
1334
9bf0d5a1f0cf Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1192
diff changeset
     2
.. include:: HEADER.rst
1192
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
========
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
 Audio.
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
========
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
.. contents::
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
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
 * http://wiki.debian.org/ALSA
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
 * http://wiki.debian.org/SoundFAQ
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
1657
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    45
Check HDA params.
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    46
=================
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    47
::
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    48
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    49
  $ sudo apt-get install alsa-tools-gui
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    50
  $ hdajackretask
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    51
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    52
See also:
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    53
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    54
  http://www.alsa-project.org/main/index.php/HDA_Analyzer
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    55
    provides a graphical interface to access the raw HD-audio control
b5bc03faed27 Check HDA params.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1630
diff changeset
    56
1192
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    57
Suitable convertors?
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    58
====================
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    59
::
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    60
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    61
  $ sudo apt-get install ffmpeg
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    62
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    63
or::
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    64
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    65
  $ sudo apt-get install sox
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    66
1630
e3bffa18d09d Play simple sounds.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1610
diff changeset
    67
List of sox supported format: See sox(1).
1192
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    68
1630
e3bffa18d09d Play simple sounds.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1610
diff changeset
    69
List of ffmpeg supported format::
1192
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
  $ ffmpeg -formats
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
How convert amr to ogg/mp3?
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
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    76
TODO
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    77
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    78
How easy convert between mp3/wav/ogg?
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    79
=====================================
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
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
  $ sox in.mp3 out.ogg
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    83
  $ sox in.ogg out.wav
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    84
  ... etc
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
How convert flac to mp3?
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    87
========================
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    88
::
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    89
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    90
  $ 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
    91
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    92
How convert wma to mp3?
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    93
=======================
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    94
::
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
  $ mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader $file.wma
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    97
  $ lame -m s audiodump.wav -o "$file.mp3
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    98
  $ rm audiodump.wav
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
How convert m4a to 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
::
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
  $ faad -o - $file.m4a | lame -V 0 - $file.mp3
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   105
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   106
How split mp3/ogg files?
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   107
========================
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   108
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   109
Split mp3 and ogg files::
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   110
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   111
  $ mp3splt
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
See::
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   114
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   115
  http://mp3splt.sourceforge.net/mp3splt_page/home.php
544e05263a39 Sound in Debian.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   116
                home page