Play files in linux

команда aplay в Linux с примерами

aplay — это аудиоплеер командной строки для драйверов звуковой карты ALSA (Advanced Linux Sound Architecture) . Он поддерживает несколько форматов файлов и несколько звуковых карт с несколькими устройствами. Он в основном используется для воспроизведения звука в интерфейсе командной строки. aplay — почти то же самое, что и arecord, только он играет вместо записи. Для поддерживаемых форматов звукового файла частота выборки, битовая глубина и т. Д. Могут быть автоматически определены из заголовка звукового файла.

Синтаксис:

Если имя файла не указано, используется стандартный вывод.

Параметры:

  • -h, –help: показать справочную информацию.
  • –Version: печатать текущую версию.
  • -l, –list-devices: перечислить все звуковые карты и цифровые аудиоустройства.
  • -L, –list-pcms: список всех определенных PCM (импульсная кодовая модуляция).
  • -D, –device = NAME: выбрать PCM по имени.
  • -q –quiet: Тихий режим. Подавить сообщения (не звук :)).
  • -t, –file-type TYPE: Тип файла (voc, wav, raw или au). Если этот параметр не указан, используется формат WAVE.
  • -c, –channels = #: количество каналов. По умолчанию используется один канал. Допустимые значения: от 1 до 32.
  • -f –format = FORMAT: если формат не указан, используется U8.
  • -r, –rate = #: частота дискретизации в герцах. Скорость по умолчанию составляет 8000 Гц.
  • -d, –duration = #: прерывание через # секунд.
  • -s, –sleep-min = #: Мин. тики для сна. По умолчанию это не спать.
  • -M, –mmap: использовать режим ввода-вывода с отображением в память (mmap) для аудиопотока. Если эта опция не установлена, будет использоваться режим ввода / вывода для чтения / записи.
  • -N, –nonblock: открыть аудиоустройство в неблокирующем режиме. Если устройство занято, программа немедленно закроется .

Примечание. Эта команда содержит различные другие параметры, которые нам обычно не нужны. Если вы хотите узнать больше о вас, вы можете просто запустить следующую команду на вашем терминале.

Признанные образцы форматов: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE IEC958_SUBFRAME_LE IEC958_SUBFRAME_BE MU_LAW A_LAW IMA_ADPCM MPEG GSM СПЕЦИАЛЬНОЕ S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE G723_24 G723_24_1B G723_40 G723_40_1B DSD_U8 DSD_U16_LE DSD_U32_LE DSD_U16_BE DSD_U32_BE

Примечание. Некоторые из них могут быть недоступны на выбранном оборудовании.

Примеры:

    Воспроизведение аудио всего 10 секунд на частоте 2500 Гц.

Воспроизведение полного аудиоклипа на частоте 2500 Гц.

Показать информацию о версии.

Источник

Ubuntu Documentation

Discussion on this wiki can be found here

New Ubuntu users can often find Wine to be intimidating and difficult to use. PlayOnLinux simplifies much of this and makes installing and using Windows programs in Ubuntu easier.

This how-to is so that both new users, and other users who find Wine too confusing, can nevertheless use it easily.

Disclaimers and Warnings

Wine is not a perfect replacement for Windows; in fact, it is rather limited. Most Windows programs will not work under Wine; some will be buggy, and a few will work well. Refer to the Wine database to find how well your preferred Windows application is likely to work.

  • Some Windows programs will run slower under Linux, and others faster. It seems to depend on your hardware and available drivers.
  • Why use PlayOnLinux?

    1. GUI; no need for the command line interface (CLI).
    2. Hides the complexity of Wine.
    3. Uses «virtual drives» (see notes below).

    Some applications are «supported» (e.g. Internet Explorer, Windows Media Player, Microsoft Office, Spore); PlayOnLinux automates their installation.

  • You can manually install «unsupported» applications.
  • What is a «virtual drive»?

      Think of each virtual drive as a separate Windows machine. If you install each program in its own virtual drive:

        Windows programs don’t interfere with each other.

      Uninstalling a badly-functioning or unwanted program is easy (PlayOnLinux simply deletes the virtual drive).

    You can, if you want, install several programs on a single virtual drive, but usually it is easier and safer to give each program its own virtual drive.

    What are the cons of using PlayOnLinux?

    PlayOnLinux is just a front-end to Wine. Therefore, it has all the same cons as using Wine; many Windows programs don’t work, or they work with flaws.

  • Sometimes, installing a Windows program can be a little buggy. For example, I have previously installed Publisher 2003 without any problem, but when redoing it for this how-to I had a problem.
  • Some programs may not work on a 64-bit installation.
  • What alternatives are there?

      Instead of using Wine, which has many imperfections…

      You can use Crossover from Codeweavers. Being commercial software, it is not free, but it is likely to support Windows programs better. There is a great Compatibility search bar at the top of the web page. Crossover «revolves around the Wine project» (Codeweaver’s wording), and the company shares all improvements with Wine.

      For the finest results, either dual-boot with Windows, or run Windows in a virtual machine such as VirtualBox (if your machine can handle it). This gives you 100% compatibility, but of course you do need a Microsoft Windows license.

    How to install PlayOnLinux

    PlayOnLinux comes in the default repositories, but I prefer to have the latest version available.

    Use the latest available version (optional)

    Open the Ubuntu Software Centre > Edit > Software Sources > Other Software > Add.

    In APT line, type the following (replace «precise» with your distro, e.g. «lucid», if you have an earlier version):
    Press Add Source.

    Close the window; open a terminal and enter the following. (If you don’t like the terminal, open Update Manager instead and select Check.)

    Install PlayOnLinux

      Open the Ubuntu Software Centre.

    «Initialise» PlayOnLinux

    On Gnome Classic, you will find PlayOnLinux under your Games menu (I’m not sure why it’s there!). On Unity, of course, you can just use the Dash.

    Open PlayOnLinux. Often when you do this, it will «refresh»:

    But the very first time you run it, PlayOnLinux will lead you through a process to download the Microsoft fonts. You must be connected to the Internet and agree to the license conditions.

    Follow the instructions.

    How to install a «supported» Windows program

    When PlayOnLinux «supports» a program, it automates the process for you. I will illustrate this through an example: Internet Explorer 8.

    Start PlayOnLinux > the big Install button at the top > Internet > Internet Explorer 8 (or you can use the search bar).

    1. Press Install.
    2. For some programs, e.g. Microsoft Office or Spore, you will need the original (legal) CD, DVD or purchased download.

    Follow the instructions.
    Remember: when the installation asks if you want to restart your computer, this applies to your pretend Windows machine, and not to your Ubuntu machine; you can safely go ahead and press the Windows restart button. PlayOnLinux will intelligently realise what is happening and restart your virtual installation without affecting your Ubuntu session.

    Once installed, you will see a launcher on your desktop (which you can delete if you want), and another on the PlayOnLinux window. Double-click either of them to open and test the application.

    How to install an «unsupported» Windows program

      The process for installing an «unsupported» program is similar to installing a «supported» one. However, you will be given extra options.

    Start PlayOnLinux > the big Install button at the top > Install a non-listed program (at the bottom left of the window).

    A wizard appears. Press Next > Install a program in a new virtual drive (unless you want to use an existing virtual drive) > Next. This creates a new, independent, virtual drive (a pretend Windows machine), independently of any other Windows programs you have installed.

    Type a suitable short name without any spaces, e.g. Quicken.
    Press Next, and Next again.

    Browse to the installation file, which may be, for example, an autorun.exe on a CD or a downloaded .exe file.

      Follow the prompts, which will depend on the application you are installing.

    Once installed, you will see a launcher on your desktop (which you can delete if you want), and another on the PlayOnLinux window. Double-click either of them to open the application.

    How to uninstall a Windows program

      Uninstalling a Windows program is easy.

    Start PlayOnLinux > select the application you want to uninstall > press the big Remove button.

    A wizard appears > Next.

    When asked, «Do you want to delete the virtual drive», press Yes > Next.

    What if my application does not appear?

      Sometimes, an installation fails (not even the installation process for that application works). Your virtual drive has been created, but you cannot see the application. You can delete the virtual drive as follows.

    Close PlayOnLinux (and any programs started from PlayOnLinux, if any).

    Open Nautilus and navigate to your home folder > PlayOnLinux’s virtual drives.

  • Find the virtual drive you wish to delete, and delete it. Do not delete default.
  • PlayOnLinux (последним исправлял пользователь elfy 2012-07-18 10:40:46)

    The material on this wiki is available under a free license, see Copyright / License for details
    You can contribute to this wiki, see Wiki Guide for details

    Источник

    Delightly Linux

    Playing DSD Audio Files in Linux

    📅 September 6, 2016
    “Can I play DSD files in Linux?”

    Yes. However, the process is not exactly user-friendly due to DSD being a rather obscure audio format compared to FLAC and MP3. If you want to play .dsf or .dff files in Linux, you must first install players that will support DSD or convert DSD into PCM.

    DSD, the acronym for Direct Stream Digital, is the audio encoding format

    used in Super Audio CDs (SACD). Remember those? They were often hybrid CDs that contained standard CD audio for playback on regular CD players in addition to high resolution audio that offered improved fidelity and more audio channels to accommodate surround sound.

    Introduced in 1999, the SACD technology never caught on, but the underlying encoding mechanism, DSD, is still around today. Some online music stores offer high-resolution music as a DSD download in order to offer the best sound quality possible that are as close to the original recordings as possible. These music files are often encoded as .dsf (DSD Storage Facility) or .dff (DSD Interchange File Format/DSDIFF) audio files.

    “Will Linux play DSD music files?”

    Yes, but this is where the controversy lies. DSD is a 1-bit pulse-density modulation technique while Linux (as well as other operating systems, so this is not a Linux issue) is glued to the PCM (pulse-code modulation) technique utilizing 8/16/24/32 bits to represent audio. If you convert DSD to PCM, can it still be called DSD?

    The differences over “which is better” can lead into some advanced acoustics theory and mathematics (in addition to heated audiophile debates), so we will leave those topics alone. The point is that these are two different techniques, and to play DSD on Linux, some form of conversion into PCM is required — at least given the common consumer-grade computer hardware that I had available.

    No special audio hardware was used even though DSD integrated circuits on studio-grade recording hardware do exist. I played DSD files through the standard analog stereo audio output jack found on the motherboard.

    “What do I need to play DSD?”

    You need the right software. The existing audio players bundled with Linux and those found in the repository, such as VLC, Audacious, and Totem, do not play DSD natively.

    The following players all worked well with DSD.

    DeaDBeef

    DeaDBeef 0.7.2 playing a .dff file. Information about the .dff file is shown in the status bar on the bottom. Audio is playing through the 3.5mm analog line output located on the motherboard. No special DSD hardware required.

    My favorite. DeaDBeef (Yes, it’s spelled that way) is a simple audio player that plays .dsf files natively. You can skip to other sections of the track as it plays. Download for your version of Linux (32-bit or 64-bit). There is no installation.

    As far as I know, no additional codecs were required with DeadBeef on my test system (unless they were already installed). Extract and go. The few DSD test files I had (some DSD files are in the public domain) played perfectly in Linux Mint 18. Both .dsf (DSD64) and .dff (DSD128) played.

    The only drawback appears to be interpreting the file information. In the screenshot above, we see DSD128 stats, but the file was tested on real DSD playback hardware in addition to source material verification. This is indeed a DSD64 2822 kHz file, not a DSD128 as being reported. It seems DeaDBeef does not interpret file information playback properly for .dff in this case. However, this could be the result of conversion needed in order to play the file back, and this is what is being reported in the status bar. Nonetheless, the file played perfectly and it sounded as good as it can get using motherboard stereo analog output.

    HQPlayer

    HQPlayer 3.13.3 playing a .dff music file.

    Unlike DeaDBeef, HQPlayer is not free. There is a free 30-day, 30-minute per use free trial.

    The trial version of HQPlayer limits playback to 30 minutes at a time for 30 days.

    HQPlayer plays DSD files (.dsf and .dff). It offers a fancy GUI that we are accustomed to seeing in media players. However, I could not skip through a track when playing DSD files. It was all from the beginning or nothing at all even though we see a progress bar.

    Download the .deb for your version of Linux and install. HQPlayer is selectable from the Linux Mint menu. HQPlayer offers a number of advanced features beyond DSD playback, so it is worth looking into. I used the Ubuntu 14.04 version in Linux Mint 18. Runs well.

    dsf2flac

    For those who enjoy the command line, dsf2flac converts a DSD file into FLAC (Free Lossless Audio Codec). You then play the FLAC file.

    A simple example:

    dsf2flac (revision 51) converting a DSD64 .dff file into an 88 kHz 2443 kbps .flac for playback.

    dsf2flac does not play a DSD file, it only converts to FLAC. Both .dsf and .dff files will convert.

    Audacious playing the .dff file just converted to FLAC.

    After conversion to FLAC, you can play the file in any common player that supports FLAC.

    You can get fancy with dsf2flac, as in this article piping to ffmpeg, so explore and enjoy!

    Other DSD Playback

    These are not the only three DSD playback methods. Here are two more in case you are interested in dedicated music servers:

    • Daphile is a headless music server for networks that support DSD playback. This is an ISO server download, not a music player.
    • Voyage MPD is similar in concept to Daphile. It is also a Linux ISO download for producing a computer audio source.

    When discussing DSD playback, DSD over PCM (DoP or DOP) is encountered. This means the DSD stream is converted into PCM before or during playback. It is practically a necessity for playing back DSD files since most hardware people have is PCM hardware. You need true DSD hardware (expensive hardware by comparison to existing consumer hardware) in order to play back DSD files without the conversion. DoP is the name for this process.

    “Does the music still sound good if converted from DSD to PCM?”

    I cannot tell a difference. Both the DSD on real DSD hardware and DoP sound equally good to me. On a computer, the DoP and the converted FLAC using dsf2flac sound excellent. It could be that my playback hardware is too limited in its specifications to distinguish any fine differences that audiophiles on high-end hardware might hear, but the end result is excellent to me. No noise. No distortion. The converted signal sounds just as pure as the original DSD.

    If the conversion is performed to FLAC with the highest quality, such as the default of dsf2flac, I cannot notice a difference.

    “Which is better: MP3, FLAC, or DSD?”

    Whichever you prefer. For sound quality, FLAC and DSD sound equally good to me. Both sound much, MUCH better than any 320 kbps stereo MP3. If you need the greatest compatibility with playback devices, MP3 is the most portable, but sound quality suffers because MP3 is a lossy codec.

    After performing many tests involving MP3/FLAC/DSD for researching this article, MP3 — even at its highest quality setting — sounds dull and flat compared to the same recording in FLAC or DSD. Of course, if you have never heard a true high-resolution recording in FLAC or DSD and you have only heard MP3 quality, then you will miss nothing. You need to hear the same music in the different formats to tell a difference.

    I tested a few public domain DSD files by downloading their FLAC and MP3 versions at their highest quality settings. Here is my opinion based upon my everyday listening:

    Sound Quality Comparison:

    • DSD/FLAC – No difference. Both sound stellar.
    • MP3Yuck! After hearing DSD/FLAC and then comparing to MP3, the MP3 version always sounded duller — as if the life had been sucked out of it. The highest quality MP3 at 320 kbps could not compare to DSD or FLAC.

    To help give a comparison, suppose you have a high-resolution image in its raw format and convert it into other file formats. DSD/FLAC would be comparable to PNG (lossless and better colors) while MP3 would be comparable to JPEG at 92 compression (lossy with duller colors and compression artifacts). Both PNG and JPEG can look good on their own, but until you compare them side-by-side, it is hard to appreciate the minute differences. DSD/FLAC vs. MP3 is the same way.

    However, few portable music players support FLAC and even fewer support DSD. MP3 plays on almost anything, so there is a tradeoff. Besides, headphones and amplifiers are a large part of the equation. If you are playing a DSD or FLAC on low-quality “cheapie” earphones from a low-end music player, then the DSD/FLAC will sound no better than an MP3. I tried different headphones, and they do make a difference.

    Answering the question “Which sounds better” depends upon a number of factors.

    “If I convert my MP3/M4A/OGG/WAV/FLAC to DSD, will my music sound better?”

    If you do, it will sound just like the original file. You cannot add quality that is not already present. In fact, you might make the resulting music sound slightly worse due to the conversion process.

    “How large is the DSD file size?”

    Larger than FLAC or MP3. Much larger. Expect a gigabyte or more for a standard CD-length album. As a comparison, here are the file sizes of the same music file in DSD, FLAC, and MP3 formats. The music is 5 minutes 7 seconds in length.

    At 216 MB for about 5 minutes of music, this can add up to 2.5 GB of space for one hour of music. Of course, music file sizes vary like any other compressed content.

    “Where can I find DSD music files?”

    A few high-resolution online shops sell full music albums in DSD format, and there are a few public domain (free) DSD music files. Other than that, DSD downloads are almost nonexistent.

    DSD is a rare format compared to MP3 or FLAC, and I can see it disappearing in favor of FLAC over time.

    “Should I bother with DSD?”

    In my opinion, no. Use FLAC instead. DSD offers high quality audio archives, but so does PCM. With standard computer hardware, sound editing must be performed in PCM anyway. Another problem with DSD is that it is a different technology compared to PCM, and converting to and from PCM can degrade the sound quality. Any conversion process has the potential of doing this.

    Who uses DSD? Unless you have specialized hardware, playing DSD in its native format is not possible, so it must be converted into PCM first. Online, high-resolution audio is for sale, and many offer DSD downloads. Usually, retailers also offer FLAC, which is also lossless and supports specifications comparable or exceeding DSD.

    FLAC is open source, non-proprietary, and far more compatible with existing software and many hardware music players. FLAC sounds incredibly good, and, just like DSD, its sound quality is superior to MP3 or any other lossy audio format (at the expense of a greater file size). In fact, depending upon the reports, some say FLAC 24-bit 96 kHz is equivalent to DSD64 2.8224 MHz. Those specs sound fantastic to my ears, and I cannot distinguish a difference between them, so why not use the more compatible FLAC?

    When you delve into the realm of high-resolution audio, you need high-end audio hardware. This article focused on playing DSD files in Linux using the generic motherboard audio to demonstrate that it is possible. However, if you desire high-quality sound from your computer when playing DSD files, you need to invest in a high-end sound card with digital output and use a quality amplifier and speakers or headphones to truly appreciate the better sound that DSD and FLAC make possible.

    Further Reading

    DSD makes an interesting topic. For more information, here are some links to get started:

    Источник

    Читайте также:  Intel core i5 8400 драйвера графики windows 10
    Оцените статью