GUI for exact audio player by Sergei Petrov

OSS specific Linux discussion (x86/amd64)

Moderators: hannu, dev, cesium

igorzwx
Known Member
Posts: 1256
Joined: Sun Jun 28, 2009 9:31 pm

Re: GUI for exact audio player by Sergei Petrov

Postby igorzwx » Wed Jan 14, 2015 12:51 am

ossuserr wrote:I can't modify your scripts. They failed. I am not a script writer.


You may try this script:

Code: Select all

$ cat EAP_FLAC_script.sh
#!/bin/sh
#

rm -f tmp.wav
rm -f tmp2

for i in *.flac
do flac -d -o tmp.wav "$i"

echo
echo “$i”
echo
echo flac – READY
echo

./pcm_conv -f 48000 -b 16 tmp.wav tmp2

echo
echo “$i”
echo
echo pcm_conv – READY
echo

rm -f tmp.wav

echo
echo “$i”
echo
echo ossplay -R -vvvv “$i”
echo

ossplay -R -vvvv tmp2

wait

rm -f tmp2

done


How to use:

Code: Select all

$ ls
01 - Tala Rasa Ranga.flac
05 - Tabla-Tabla Tarang.flac
EAP_FLAC_script.sh
pcm_conv


Run the script:

Code: Select all

$ ./EAP_FLAC_script.sh


EXAMPLE:

Code: Select all

$ ./EAP_FLAC_script.sh

flac 1.2.1, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007  Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

01 - Tala Rasa Ranga.flac: done         

“01 - Tala Rasa Ranga.flac”

flac – READY

=================================================================
Module Info:

Short name: WAVE PCM Converter
Long name : Convert PCM format for WAVE files
Copyright : Copyright (c) 2009-10 PetrovSE
Version   : 1.0.2.4
Build     : Sep 14 2010, 10:51:15
=================================================================

Input file : tmp.wav
Samples rate    = 44100 Hz
Channels        = 2
Bits per sample = 16 (fixed)

Output file: tmp2
Samples rate    = 48000 Hz
Channels        = 2
Bits per sample = 16 (fixed)

   LFE   SL   L   C   R   SR
LFE    -----   -----   -----   -----   -----   -----
SL     -----   -----   -----   -----   -----   -----
L      -----   -----   1.000   -----   -----   -----
C      -----   -----   -----   -----   -----   -----
R      -----   -----   -----   -----   1.000   -----
SR     -----   -----   -----   -----   -----   -----

[|||||||||||||||||||||||||||||||||||||||||||||||||||]  99.2 %
Ok.

File duration  : 178.293333 sec
Processing time: 2.549104 sec ( 1.43% of real time)

“01 - Tala Rasa Ranga.flac”

pcm_conv – READY


“01 - Tala Rasa Ranga.flac”

ossplay -R -vvvv “01 - Tala Rasa Ranga.flac”

FORM len = 34211884
tmp2: Reading chunk fmt , size 16, pos 0, next 12
FMT chunk: len = 16, fmt = 0
tmp2: Reading chunk data, size 34211840, pos 0, next 36
DATA chunk. Offs = 44, len = 34211840
Playing WAVE file tmp2, 16 bits/stereo/48000 Hz
Setup device S16_LE/2/48000
Time: 02:58.19 of 02:58.19 VU 0         

flac 1.2.1, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007  Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

05 - Tabla-Tabla Tarang.flac: done         

“05 - Tabla-Tabla Tarang.flac”

flac – READY

=================================================================
Module Info:

Short name: WAVE PCM Converter
Long name : Convert PCM format for WAVE files
Copyright : Copyright (c) 2009-10 PetrovSE
Version   : 1.0.2.4
Build     : Sep 14 2010, 10:51:15
=================================================================

Input file : tmp.wav
Samples rate    = 44100 Hz
Channels        = 2
Bits per sample = 16 (fixed)

Output file: tmp2
Samples rate    = 48000 Hz
Channels        = 2
Bits per sample = 16 (fixed)

   LFE   SL   L   C   R   SR
LFE    -----   -----   -----   -----   -----   -----
SL     -----   -----   -----   -----   -----   -----
L      -----   -----   1.000   -----   -----   -----
C      -----   -----   -----   -----   -----   -----
R      -----   -----   -----   -----   1.000   -----
SR     -----   -----   -----   -----   -----   -----

[|||||||||||||||||||||||||||||||||||||||||||||||||||]  99.2 %
Ok.

File duration  : 211.173333 sec
Processing time: 3.062056 sec ( 1.45% of real time)

“05 - Tabla-Tabla Tarang.flac”

pcm_conv – READY


“05 - Tabla-Tabla Tarang.flac”

ossplay -R -vvvv “05 - Tabla-Tabla Tarang.flac”

FORM len = 40519724
tmp2: Reading chunk fmt , size 16, pos 0, next 12
FMT chunk: len = 16, fmt = 0
tmp2: Reading chunk data, size 40519680, pos 0, next 36
DATA chunk. Offs = 44, len = 40519680
Playing WAVE file tmp2, 16 bits/stereo/48000 Hz
Setup device S16_LE/2/48000
Time: 03:31.04 of 03:31.04 VU 0   

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: GUI for exact audio player by Sergei Petrov

Postby ossuserr » Thu Jan 15, 2015 4:21 pm

The player is finished. Enjoy.

Play flacs on linux with OSS via Thunar.

Install thunar, xfce4-terminal, flac and zenity to linux. Some C++ libraries may be also required to use Petrov's resampler.

In Thunar: go to edit-configure custom actions. Press plus and put as follows:
Into the name field: playvlacs
Into the command field:

Code: Select all

files=$(zenity --title "open to play" --file-selection --multiple %F) ; echo $files > listovvlaks1 && tr '|' '\n'  < listovvlaks1 > listovvlaks  && rm -f listovvlaks1 && xfce4-terminal -x ~/exact-audio-player/playflacs


Into the apperance conditions TAB:
Pattern field: *
Check ON all boxes too in this TAB.

Create exact-audio-player directory.

Code: Select all

$ mkdir ~/exact-audio-player

The newly created directory should contain three files:
1) Petrov's resampler for OSS called "pcm_conv". Find it on the OSS driver site. It's in the package Exact Audio Player.

2) The following script called "playflacs":
Create a text document with the name playflacs, paste the following code into it

Code: Select all

#!/bin/bash
cat listovvlaks |grep .flac$ |while read file
do
flac -f -d "$file" -o tmp.wav
~/exact-audio-player/petrov-resampler-sox-bak2
done
rm -f listovvlaks
exit 0


Make it executable by the command

Code: Select all

$ sudo chmod +x ~/exact-audio-player/playflacs


3) The script called "petrov-resampler-sox-bak2"
Create a text document with the name petrov-resampler-sox-bak2, paste the following code into it

Code: Select all

#!/bin/sh
#
# Exact Audio Player for Open Sound System (OSS4) 
#
# A simple script to play FLAC with Petrov's exact resampler (pcm_conv)
#
#    FLAC → SoX → WAVE → Petrov's Exact Resampler → ossplay -R
#
#    ./petrov-resampler-sox audio.flac 96000 32
#
# All available options for the exact resampler are in the help file: ./pcm_conv -h
# If you need more specific options, contact the author:
# Sergey Petrov petrovse@mail.ru
#
# Sound is played directly to the sound device through the help of "ossplay -R",
# see "man ossplay". You do not need, therefore, to disable resampling in OSS Mixer,
# but you have to know exactly which formats are supported by your soundcard.
#
#
# Supply three arguments:
# (1) name of the audio file
# (2) sample rate [RATE]
# (3) bit rate [BITS]
#
# Run the script by command:
#
# ./petrov-resampler-sox [audio-file.flac] [sample rate] [bit rate]
#
# EXAMPLE:
#
# ./petrov-resampler-sox audio.flac 48000 16
#
# DEFAULT Values:
# sample rate = 48000Hz
# bit rate = 16bit
#

# Reads the parameters from the command line.
RATE=$2

BITS=$3

# Tests if the RATE was specified. If not, take default value
if [ "$RATE" = "" ]; then
   RATE="48000"
fi

# Tests if the BITS was specified. If not, take default value
if [ "$BITS" = "" ]; then
   BITS="16"
fi

# Default values:
#RATE=48000
#BITS=16

TMPF1=tmp.wav

TMPF=s_file

# Perform sample rate conversion
~/exact-audio-player/pcm_conv -f $RATE -b $BITS $TMPF1 $TMPF

# Start playing
ossplay -R $TMPF

# Remove temporal files
rm -f $TMPF1

rm -f $TMPF


Make it executable by the command

Code: Select all

$ sudo chmod +x ~/exact-audio-player/petrov-resampler-sox-bak2


Now, TO PLAY FLACS, right click on any file or empty space in Thunar and choose "playvlaks". Zenity windows will appear to choose files for playing. The upper files are played first, so you may try to sort them by name or file size or otherwise by clicking on the upper part of the corresponding column. After selecting files press OK and the selected files will be played.

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: GUI for exact audio player by Sergei Petrov

Postby ossuserr » Mon Jan 04, 2016 8:59 pm

I am enjoying music with DB + Petrov's plugin for DB + OSS. Amazing! Best sound ever!
Igor, return to the forum, otherwise alsa will totally win.

igorzwx
Known Member
Posts: 1256
Joined: Sun Jun 28, 2009 9:31 pm

Re: GUI for exact audio player by Sergei Petrov

Postby igorzwx » Mon Jan 04, 2016 10:52 pm

ossuserr wrote:I am enjoying music with DB + Petrov's plugin for DB + OSS. Amazing! Best sound ever!
Igor, return to the forum, otherwise alsa will totally win.


Hi! It seems that you are now testing ESI Juli@ soundcard with OSS4.

Could you please post a review of this card and/or manual for OSS4 users?
You may start a new topic about this card, which might be entitled like this: "ESI Juli@ soundcard with OSS4".

Does OSS4 provide a sort of router for ESI Juli@ ?

ossuserr
Known Member
Posts: 272
Joined: Thu Jan 08, 2015 12:01 am
Sound Card: audigy 2 zs platinum, esi juli
OS: gentu riced to bo0st
Location: Earth

Re: GUI for exact audio player by Sergei Petrov

Postby ossuserr » Tue Jan 05, 2016 10:00 pm

What do you mean by router? Reply in juli@ topic.

I have found problems both with ossplay and exact audio player. They are as follows:

1. Petrov's pcm_conv can convert only .wav files and not .w64 files. What does it mean? It means that you can't use his resampler for large files because .wav format does not support files larger than 2 GB. So if you have an album of 192000\24 in one image in flac, you won't be able to use it with Petrov's player because you can't keep that album in .wav format due to size and Petrov's resampler does not accept .w64 files.

2. ossplay -R does not support 24\192000 format! Kind of shock to me. You can play only 16-bit files...

igorzwx
Known Member
Posts: 1256
Joined: Sun Jun 28, 2009 9:31 pm

Re: GUI for exact audio player by Sergei Petrov

Postby igorzwx » Tue Jan 05, 2016 11:59 pm

ossuserr wrote:What do you mean by router?


DirectWIRE router in the "Juli@ User's Guide" (pp. 41-42).
viewtopic.php?f=3&t=5807&start=105#p21357

ossuserr wrote: ossplay -R does not support 24\192000 format! Kind of shock to me. You can play only 16-bit files...


Run on terminal:

Code: Select all

$ ossplay -vvvv -R your_24bit_192kHz.wav


and post the output here.


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 3 guests