looking forward to Emms 6.0

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

looking forward to Emms 6.0

Yoni Rabkin-2

The next release of Emms will be a major update. The release will be
named 6.0 and is slated for the 1st of November 2020. Here are some of
the goals:

* Include Emms in ELPA. This will be done mostly by me.

* Find a suitable replacement for emms-print-metadata as a way to access
  taglib. A current candidate is installing pytaglib.

* Look at robust streaming audio metadata access (ICY-metadata).

Anyone who feels like championing any of these goals, or who has goals
of their own, please don't be shy. Now is the time to float these ideas.

Last but not least: thank you for everyone who submitted bugs, ideas,
and of course patches for the 5.4 release.

--
   "Cut your own wood and it will warm you twice"

Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Fran Burstall (Gmail)
* Find a suitable replacement for emms-print-metadata as a way to access
  taglib. A current candidate is installing pytaglib.

I am happy to be involved in this.  If pytaglib is to be used, it comes with a small python script called pyprinttags which outputs something like this:

*************************************************************************
TAGS OF '02. Peter Gunn (live) _ Where's Your Head At (Head-a-Pella).mp3'
*************************************************************************
ALBUM                             = As Heard on Radio Soulwax, Part 2
ALBUM ARTIST CREDIT               = 2 Many DJ’s
ALBUMARTIST                       = 2 Many DJ’s
ALBUMARTISTSORT                   = 2 Many DJ’s
ARTIST                            = Emerson, Lake & Palmer / Basement Jaxx
ARTIST CREDIT                     = Emerson, Lake & Palmer / Basement Jaxx
ARTISTSORT                        = Emerson, Lake & Palmer / Basement Jaxx
BPM                               = 0
CATALOGNUMBER                     = 941.0065.020
COMPOSER                          = Henry Mancini
DATE                              = 2003-02-17
DISCNUMBER                        = 1/1
GENRE                             = Electronica/Dance
LABEL                             = [PIAS] Recordings
LANGUAGE                          = mul
LYRICIST                          = Henry Mancini
LYRICS                            =
MEDIA                             = Enhanced CD
MUSICBRAINZ ALBUM COMMENT         = Reissue with new artwork
MUSICBRAINZ ALBUM RELEASE COUNTRY = FR
MUSICBRAINZ ALBUM STATUS          = Official
MUSICBRAINZ ALBUM TYPE            = compilation
MUSICBRAINZ RELEASE TRACK ID      = 13031913-0a36-4045-a7b7-02ddfc6abdae
MUSICBRAINZ_ALBUMARTISTID         = 82dc508a-dbda-4954-aedc-28895edfa42e
MUSICBRAINZ_ALBUMID               = fb3b6470-c0b8-4f45-91f7-238b600be93f
MUSICBRAINZ_ARTISTID              = ad996aef-cc1c-42ac-af5c-619c370f4b8a
MUSICBRAINZ_RELEASEGROUPID        = f818f48f-5266-313d-b70a-df88c522fe3c
MUSICBRAINZ_TRACKID               = 922d82f5-2afa-433f-91ed-02946125d18a
ORIGINALDATE                      = 2002-06-18
SCRIPT                            = Latn
TITLE                             = Peter Gunn (live) / Where's Your Head At (Head-a-Pella)
TRACKNUMBER                       = 2/31
Unsupported tag elements: TCMP; TIPL; TSOC; APIC

Clearly a little parsing would be necessary to get this into a shape that emms could work with.

I see two ways to go with this:

1.  write emms-info-pytaglib.el which does the parsing.

2.  write a python version of emms-print-metadata that is a drop-in replacement for the C version.

Both are easy though option 2 is probably easier.  The downside of option 2 is that we still have a piece of non-elisp to install in the user's path.

Preferences?

---Fran





Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Yoni Rabkin-2
"Fran Burstall (Gmail)" <[hidden email]> writes:

>     * Find a suitable replacement for emms-print-metadata as a way to
>     access
>       taglib. A current candidate is installing pytaglib.
>
>
> I am happy to be involved in this.  If pytaglib is to be used, it
> comes with a small python script called pyprinttags which outputs
> something like this:

Thank you for stepping up.

>     *************************************************************************
>     TAGS OF '02. Peter Gunn (live) _ Where's Your Head At
>     (Head-a-Pella).mp3'
>     *************************************************************************
>     ALBUM                             = As Heard on Radio Soulwax,
>     Part 2
>     ALBUM ARTIST CREDIT               = 2 Many DJ’s
>     ALBUMARTIST                       = 2 Many DJ’s
>     ALBUMARTISTSORT                   = 2 Many DJ’s
>     ARTIST                            = Emerson, Lake & Palmer /
>     Basement Jaxx
>     ARTIST CREDIT                     = Emerson, Lake & Palmer /

[snip]

I got something like this:

************************************
TAGS OF '01 - Prelude - Prelude.mp3'
************************************
ALBUM       = Verdi: La Traviata
COMMENT     = Amazon.com Song ID: 204947184
COPYRIGHT   = (C) 2005 Deutsche Grammophon GmbH, Hamburg
CONDUCTOR   = Carlo Rizzi
ARTIST      = Wiener Philharmoniker
TITLE       = Prelude - Prelude
GENRE       = Classical
ALBUMARTIST = Anna Netrebko
COMPOSER    = Giuseppe Verdi
DATE        = 2005
TRACKNUMBER = 1/22
DISCNUMBER  = 1/2
Unsupported tag elements: PRIV; APIC

...which looks easy enough to parse.

Unfortunately, installing pytaglib on my Trisquel machine was as much
work as emms-print-metadata. It involved manually downloading
pytaglib-0.3.4, then installing cython, then:

$ python setup.py build
$ python setup.py install --user

But I assume that it is easier on systems with pip, so this isn't a
show-stopper. Moreover, it shows that this can run on a completely free
system. If it couldn't then that would be another show-stopper.

As an aside: looking at the command line of pyprinttags I note that
we'll have to add the "-b" (batch) option so that pyprinttags doesn't
try to ask the user questions and hang the elisp process call.

> Clearly a little parsing would be necessary to get this into a shape
> that emms could work with.
>
> I see two ways to go with this:
>
> 1.  write emms-info-pytaglib.el which does the parsing.
>
> 2.  write a python version of emms-print-metadata that is a drop-in
> replacement for the C version.
>
> Both are easy though option 2 is probably easier.  The downside of
> option 2 is that we still have a piece of non-elisp to install in the
> user's path.
>
> Preferences?

Absolutely option 1, since otherwise we would be shipping C, C++, Perl,
and Python; no thank you. The idea is to let the OS provide the
packages, and let elisp do the rest. This is as opposed to what we do
now, which is: let the OS provide a package, provide some glue code, and
then let elisp do the rest. We are trying to get rid of the glue.

I can write an implementation of emms-info-pytaglib and ping you to test
it once I'm done, or you can do that. It really depends on whether you
feel like writing that would be fun for you; your choice. Thank you
nevertheless.

--
   "Cut your own wood and it will warm you twice"

Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Pierre Neidhardt-2
In reply to this post by Yoni Rabkin-2
Hi!

An idea that was mentioned some years ago: use tabulated-list mode for
the browser and the playlist.  Some of the benefits include easier
display customization and sorting.

Sadly I don't have time to work on it myself :p
Any taker?  Opinions?

Cheers!

--
Pierre Neidhardt
https://ambrevar.xyz/

signature.asc (497 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Yoni Rabkin-2
Pierre Neidhardt <[hidden email]> writes:

> Hi!
>
> An idea that was mentioned some years ago: use tabulated-list mode for
> the browser and the playlist.  Some of the benefits include easier
> display customization and sorting.
>
> Sadly I don't have time to work on it myself :p
> Any taker?  Opinions?

How does kill-yank work in tabulated-list mode? Is it the same as in a
typical emacs text buffer?

--
   "Cut your own wood and it will warm you twice"

Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Pierre Neidhardt-2
> How does kill-yank work in tabulated-list mode? Is it the same as in a
> typical emacs text buffer?

You can delete entries.

As for moving them around I'm not sure but if it does not exist already
I guess it wouldn't be too hard to implement.

--
Pierre Neidhardt
https://ambrevar.xyz/

signature.asc (497 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Fran Burstall (Gmail)
In reply to this post by Yoni Rabkin-2
I can write an implementation of emms-info-pytaglib and ping you to test
it once I'm done, or you can do that. It really depends on whether you
feel like writing that would be fun for you; your choice. Thank you
nevertheless.

I will give writing that a go...

---Fran

Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Fran Burstall (Gmail)
In reply to this post by Yoni Rabkin-2
pyprinttags fails to provide playing-time which emms-print-metadata does get by querying TagLib::AudioProperties.

Is this a show-stopper?

---Fran

>     *************************************************************************
>     TAGS OF '02. Peter Gunn (live) _ Where's Your Head At
>     (Head-a-Pella).mp3'
>     *************************************************************************
>     ALBUM                             = As Heard on Radio Soulwax,
>     Part 2
>     ALBUM ARTIST CREDIT               = 2 Many DJ’s
>     ALBUMARTIST                       = 2 Many DJ’s
>     ALBUMARTISTSORT                   = 2 Many DJ’s
>     ARTIST                            = Emerson, Lake & Palmer /
>     Basement Jaxx
>     ARTIST CREDIT                     = Emerson, Lake & Palmer /

[snip]

I got something like this:

************************************
TAGS OF '01 - Prelude - Prelude.mp3'
************************************
ALBUM       = Verdi: La Traviata
COMMENT     = Amazon.com Song ID: 204947184
COPYRIGHT   = (C) 2005 Deutsche Grammophon GmbH, Hamburg
CONDUCTOR   = Carlo Rizzi
ARTIST      = Wiener Philharmoniker
TITLE       = Prelude - Prelude
GENRE       = Classical
ALBUMARTIST = Anna Netrebko
COMPOSER    = Giuseppe Verdi
DATE        = 2005
TRACKNUMBER = 1/22
DISCNUMBER  = 1/2
Unsupported tag elements: PRIV; APIC

...which looks easy enough to parse.

Unfortunately, installing pytaglib on my Trisquel machine was as much
work as emms-print-metadata. It involved manually downloading
pytaglib-0.3.4, then installing cython, then:

$ python setup.py build
$ python setup.py install --user

But I assume that it is easier on systems with pip, so this isn't a
show-stopper. Moreover, it shows that this can run on a completely free
system. If it couldn't then that would be another show-stopper.

As an aside: looking at the command line of pyprinttags I note that
we'll have to add the "-b" (batch) option so that pyprinttags doesn't
try to ask the user questions and hang the elisp process call.

> Clearly a little parsing would be necessary to get this into a shape
> that emms could work with.
>
> I see two ways to go with this:
>
> 1.  write emms-info-pytaglib.el which does the parsing.
>
> 2.  write a python version of emms-print-metadata that is a drop-in
> replacement for the C version.
>
> Both are easy though option 2 is probably easier.  The downside of
> option 2 is that we still have a piece of non-elisp to install in the
> user's path.
>
> Preferences?

Absolutely option 1, since otherwise we would be shipping C, C++, Perl,
and Python; no thank you. The idea is to let the OS provide the
packages, and let elisp do the rest. This is as opposed to what we do
now, which is: let the OS provide a package, provide some glue code, and
then let elisp do the rest. We are trying to get rid of the glue.

I can write an implementation of emms-info-pytaglib and ping you to test
it once I'm done, or you can do that. It really depends on whether you
feel like writing that would be fun for you; your choice. Thank you
nevertheless.

--
   "Cut your own wood and it will warm you twice"
Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Yoni Rabkin-2
"Fran Burstall (Gmail)" <[hidden email]> writes:

> pyprinttags fails to provide playing-time which emms-print-metadata
> does get by querying TagLib::AudioProperties.
>
> Is this a show-stopper?

It means that it cannot be a source of duration for players that do not
provide it. For instance, the mpv backend can provide duration
information while the vlc backend cannot.

It is a rather annoying situation for us, and potentially confusing for
a user who doesn't understand what is going on under the hood.

Thank you for unearthing that. Perhaps we need to keep on looking for
other ways to get at that data.

>
>
>     >   
>      *************************************************************************
>     >     TAGS OF '02. Peter Gunn (live) _ Where's Your Head At
>     >     (Head-a-Pella).mp3'
>     >   
>      *************************************************************************
>     >     ALBUM                             = As Heard on Radio
>     Soulwax,
>     >     Part 2
>     >     ALBUM ARTIST CREDIT               = 2 Many DJ’s
>     >     ALBUMARTIST                       = 2 Many DJ’s
>     >     ALBUMARTISTSORT                   = 2 Many DJ’s
>     >     ARTIST                            = Emerson, Lake & Palmer
>     /
>     >     Basement Jaxx
>     >     ARTIST CREDIT                     = Emerson, Lake & Palmer
>     /
>    
>     [snip]
>    
>     I got something like this:
>    
>     ************************************
>     TAGS OF '01 - Prelude - Prelude.mp3'
>     ************************************
>     ALBUM       = Verdi: La Traviata
>     COMMENT     = Amazon.com Song ID: 204947184
>     COPYRIGHT   = (C) 2005 Deutsche Grammophon GmbH, Hamburg
>     CONDUCTOR   = Carlo Rizzi
>     ARTIST      = Wiener Philharmoniker
>     TITLE       = Prelude - Prelude
>     GENRE       = Classical
>     ALBUMARTIST = Anna Netrebko
>     COMPOSER    = Giuseppe Verdi
>     DATE        = 2005
>     TRACKNUMBER = 1/22
>     DISCNUMBER  = 1/2
>     Unsupported tag elements: PRIV; APIC
>    
>     ...which looks easy enough to parse.
>    
>     Unfortunately, installing pytaglib on my Trisquel machine was as
>     much
>     work as emms-print-metadata. It involved manually downloading
>     pytaglib-0.3.4, then installing cython, then:
>    
>     $ python setup.py build
>     $ python setup.py install --user
>    
>     But I assume that it is easier on systems with pip, so this isn't
>     a
>     show-stopper. Moreover, it shows that this can run on a
>     completely free
>     system. If it couldn't then that would be another show-stopper.
>    
>     As an aside: looking at the command line of pyprinttags I note
>     that
>     we'll have to add the "-b" (batch) option so that pyprinttags
>     doesn't
>     try to ask the user questions and hang the elisp process call.
>    
>     > Clearly a little parsing would be necessary to get this into a
>     shape
>     > that emms could work with.
>     >
>     > I see two ways to go with this:
>     >
>     > 1.  write emms-info-pytaglib.el which does the parsing.
>     >
>     > 2.  write a python version of emms-print-metadata that is a
>     drop-in
>     > replacement for the C version.
>     >
>     > Both are easy though option 2 is probably easier.  The downside
>     of
>     > option 2 is that we still have a piece of non-elisp to install
>     in the
>     > user's path.
>     >
>     > Preferences?
>    
>     Absolutely option 1, since otherwise we would be shipping C, C++,
>     Perl,
>     and Python; no thank you. The idea is to let the OS provide the
>     packages, and let elisp do the rest. This is as opposed to what
>     we do
>     now, which is: let the OS provide a package, provide some glue
>     code, and
>     then let elisp do the rest. We are trying to get rid of the glue.
>    
>     I can write an implementation of emms-info-pytaglib and ping you
>     to test
>     it once I'm done, or you can do that. It really depends on
>     whether you
>     feel like writing that would be fun for you; your choice. Thank
>     you
>     nevertheless.
>    
>     --
>        "Cut your own wood and it will warm you twice"
>
>
>

--
   "Cut your own wood and it will warm you twice"

Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Yoni Rabkin-2
In reply to this post by Fran Burstall (Gmail)
"Fran Burstall (Gmail)" <[hidden email]> writes:

> pyprinttags fails to provide playing-time which emms-print-metadata
> does get by querying TagLib::AudioProperties.
>
> Is this a show-stopper?

I've just had a look at python-mutagen, which installs
mutagen-inspect. It's output on my machine looks like this (ignoring the
non-standard PRIV tag):

-- /home/yrk/audio/classical/Verdi__La_Traviata__Netrebko/01 - Prelude - Prelude.mp3
- MPEG 1 layer 3, 256000 bps (CBR?), 44100 Hz, 2 chn, 216.93 seconds (audio/mp3)
APIC= (image/jpeg, 205990 bytes)
COMM==eng=Amazon.com Song ID: 204947184
TALB=Verdi: La Traviata
TCOM=Giuseppe Verdi
TCON=Classical
TCOP=(C) 2005 Deutsche Grammophon GmbH, Hamburg
TDRC=2005
TIT2=Prelude - Prelude
TPE1=Wiener Philharmoniker
TPE2=Anna Netrebko
TPE3=Carlo Rizzi
TPOS=1/2
TRCK=1/22

Do you see mutagen-inspect from python-mutagen as a candidate?

>     >   
>      *************************************************************************
>     >     TAGS OF '02. Peter Gunn (live) _ Where's Your Head At
>     >     (Head-a-Pella).mp3'
>     >   
>      *************************************************************************
>     >     ALBUM                             = As Heard on Radio
>     Soulwax,
>     >     Part 2
>     >     ALBUM ARTIST CREDIT               = 2 Many DJ’s
>     >     ALBUMARTIST                       = 2 Many DJ’s
>     >     ALBUMARTISTSORT                   = 2 Many DJ’s
>     >     ARTIST                            = Emerson, Lake & Palmer
>     /
>     >     Basement Jaxx
>     >     ARTIST CREDIT                     = Emerson, Lake & Palmer
>     /
>    
>     [snip]
>    
>     I got something like this:
>    
>     ************************************
>     TAGS OF '01 - Prelude - Prelude.mp3'
>     ************************************
>     ALBUM       = Verdi: La Traviata
>     COMMENT     = Amazon.com Song ID: 204947184
>     COPYRIGHT   = (C) 2005 Deutsche Grammophon GmbH, Hamburg
>     CONDUCTOR   = Carlo Rizzi
>     ARTIST      = Wiener Philharmoniker
>     TITLE       = Prelude - Prelude
>     GENRE       = Classical
>     ALBUMARTIST = Anna Netrebko
>     COMPOSER    = Giuseppe Verdi
>     DATE        = 2005
>     TRACKNUMBER = 1/22
>     DISCNUMBER  = 1/2
>     Unsupported tag elements: PRIV; APIC
>    
>     ...which looks easy enough to parse.
>    
>     Unfortunately, installing pytaglib on my Trisquel machine was as
>     much
>     work as emms-print-metadata. It involved manually downloading
>     pytaglib-0.3.4, then installing cython, then:
>    
>     $ python setup.py build
>     $ python setup.py install --user
>    
>     But I assume that it is easier on systems with pip, so this isn't
>     a
>     show-stopper. Moreover, it shows that this can run on a
>     completely free
>     system. If it couldn't then that would be another show-stopper.
>    
>     As an aside: looking at the command line of pyprinttags I note
>     that
>     we'll have to add the "-b" (batch) option so that pyprinttags
>     doesn't
>     try to ask the user questions and hang the elisp process call.
>    
>     > Clearly a little parsing would be necessary to get this into a
>     shape
>     > that emms could work with.
>     >
>     > I see two ways to go with this:
>     >
>     > 1.  write emms-info-pytaglib.el which does the parsing.
>     >
>     > 2.  write a python version of emms-print-metadata that is a
>     drop-in
>     > replacement for the C version.
>     >
>     > Both are easy though option 2 is probably easier.  The downside
>     of
>     > option 2 is that we still have a piece of non-elisp to install
>     in the
>     > user's path.
>     >
>     > Preferences?
>    
>     Absolutely option 1, since otherwise we would be shipping C, C++,
>     Perl,
>     and Python; no thank you. The idea is to let the OS provide the
>     packages, and let elisp do the rest. This is as opposed to what
>     we do
>     now, which is: let the OS provide a package, provide some glue
>     code, and
>     then let elisp do the rest. We are trying to get rid of the glue.
>    
>     I can write an implementation of emms-info-pytaglib and ping you
>     to test
>     it once I'm done, or you can do that. It really depends on
>     whether you
>     feel like writing that would be fun for you; your choice. Thank
>     you
>     nevertheless.
>    
>     --
>        "Cut your own wood and it will warm you twice"
>
>
>

--
   "Cut your own wood and it will warm you twice"

Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Fran Burstall (Gmail)
python-mutagen looks like a possibility but it gives different output for different filetypes.  This is what it looks like on a .ogg file

-- /home/timeshift/snapshots/2018-08-31_16-56-03/localhost/usr/share/cinnamon/sounds/bell.ogg
- Ogg Vorbis, 0.23 seconds, 96000 bps (audio/vorbis)
TITLE=bell
COMMENTS= 

I do not have any other filetypes to experiment on (flac?...) but we would have to at least internally manage ID3 frame names vs vobis comments etc

---Fran

On Sat, 2 May 2020 at 04:41, Yoni Rabkin <[hidden email]> wrote:
"Fran Burstall (Gmail)" <[hidden email]> writes:

> pyprinttags fails to provide playing-time which emms-print-metadata
> does get by querying TagLib::AudioProperties.
>
> Is this a show-stopper?

I've just had a look at python-mutagen, which installs
mutagen-inspect. It's output on my machine looks like this (ignoring the
non-standard PRIV tag):

-- /home/yrk/audio/classical/Verdi__La_Traviata__Netrebko/01 - Prelude - Prelude.mp3
- MPEG 1 layer 3, 256000 bps (CBR?), 44100 Hz, 2 chn, 216.93 seconds (audio/mp3)
APIC= (image/jpeg, 205990 bytes)
COMM==eng=Amazon.com Song ID: 204947184
TALB=Verdi: La Traviata
TCOM=Giuseppe Verdi
TCON=Classical
TCOP=(C) 2005 Deutsche Grammophon GmbH, Hamburg
TDRC=2005
TIT2=Prelude - Prelude
TPE1=Wiener Philharmoniker
TPE2=Anna Netrebko
TPE3=Carlo Rizzi
TPOS=1/2
TRCK=1/22

Do you see mutagen-inspect from python-mutagen as a candidate?

>     >   
>      *************************************************************************
>     >     TAGS OF '02. Peter Gunn (live) _ Where's Your Head At
>     >     (Head-a-Pella).mp3'
>     >   
>      *************************************************************************
>     >     ALBUM                             = As Heard on Radio
>     Soulwax,
>     >     Part 2
>     >     ALBUM ARTIST CREDIT               = 2 Many DJ’s
>     >     ALBUMARTIST                       = 2 Many DJ’s
>     >     ALBUMARTISTSORT                   = 2 Many DJ’s
>     >     ARTIST                            = Emerson, Lake & Palmer
>     /
>     >     Basement Jaxx
>     >     ARTIST CREDIT                     = Emerson, Lake & Palmer
>     /
>   
>     [snip]
>   
>     I got something like this:
>   
>     ************************************
>     TAGS OF '01 - Prelude - Prelude.mp3'
>     ************************************
>     ALBUM       = Verdi: La Traviata
>     COMMENT     = Amazon.com Song ID: 204947184
>     COPYRIGHT   = (C) 2005 Deutsche Grammophon GmbH, Hamburg
>     CONDUCTOR   = Carlo Rizzi
>     ARTIST      = Wiener Philharmoniker
>     TITLE       = Prelude - Prelude
>     GENRE       = Classical
>     ALBUMARTIST = Anna Netrebko
>     COMPOSER    = Giuseppe Verdi
>     DATE        = 2005
>     TRACKNUMBER = 1/22
>     DISCNUMBER  = 1/2
>     Unsupported tag elements: PRIV; APIC
>   
>     ...which looks easy enough to parse.
>   
>     Unfortunately, installing pytaglib on my Trisquel machine was as
>     much
>     work as emms-print-metadata. It involved manually downloading
>     pytaglib-0.3.4, then installing cython, then:
>   
>     $ python setup.py build
>     $ python setup.py install --user
>   
>     But I assume that it is easier on systems with pip, so this isn't
>     a
>     show-stopper. Moreover, it shows that this can run on a
>     completely free
>     system. If it couldn't then that would be another show-stopper.
>   
>     As an aside: looking at the command line of pyprinttags I note
>     that
>     we'll have to add the "-b" (batch) option so that pyprinttags
>     doesn't
>     try to ask the user questions and hang the elisp process call.
>   
>     > Clearly a little parsing would be necessary to get this into a
>     shape
>     > that emms could work with.
>     >
>     > I see two ways to go with this:
>     >
>     > 1.  write emms-info-pytaglib.el which does the parsing.
>     >
>     > 2.  write a python version of emms-print-metadata that is a
>     drop-in
>     > replacement for the C version.
>     >
>     > Both are easy though option 2 is probably easier.  The downside
>     of
>     > option 2 is that we still have a piece of non-elisp to install
>     in the
>     > user's path.
>     >
>     > Preferences?
>   
>     Absolutely option 1, since otherwise we would be shipping C, C++,
>     Perl,
>     and Python; no thank you. The idea is to let the OS provide the
>     packages, and let elisp do the rest. This is as opposed to what
>     we do
>     now, which is: let the OS provide a package, provide some glue
>     code, and
>     then let elisp do the rest. We are trying to get rid of the glue.
>   
>     I can write an implementation of emms-info-pytaglib and ping you
>     to test
>     it once I'm done, or you can do that. It really depends on
>     whether you
>     feel like writing that would be fun for you; your choice. Thank
>     you
>     nevertheless.
>   
>     --
>        "Cut your own wood and it will warm you twice"
>
>
>

--
   "Cut your own wood and it will warm you twice"
Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Fran Burstall (Gmail)
Another python possibility is tinytag:

pip install tinytag

python -m tinytag filename.mp3 (or whatever)

It supports the following attributes:

tag.album         # album as string
tag.albumartist   # album artist as string
tag.artist        # artist name as string
tag.audio_offset  # number of bytes before audio data begins
tag.bitrate       # bitrate in kBits/s
tag.comment       # file comment as string
tag.composer      # composer as string
tag.disc          # disc number
tag.disc_total    # the total number of discs
tag.duration      # duration of the song in seconds
tag.filesize      # file size in bytes
tag.genre         # genre as string
tag.samplerate    # samples per second
tag.title         # title of the song
tag.track         # track number as string
tag.track_total   # total number of tracks as string
tag.year          # year or data as string

Missing from the list of things that emms-print-metadata supplies are performer and the various *sort like artistsort.

Positive things: 

* like mutagen it is pure python and depends on no other libraries
* gives answers in the same format for mp3, flac and ogg...

---Fran



On Sat, 2 May 2020 at 13:05, Fran Burstall (Gmail) <[hidden email]> wrote:
python-mutagen looks like a possibility but it gives different output for different filetypes.  This is what it looks like on a .ogg file

-- /home/timeshift/snapshots/2018-08-31_16-56-03/localhost/usr/share/cinnamon/sounds/bell.ogg
- Ogg Vorbis, 0.23 seconds, 96000 bps (audio/vorbis)
TITLE=bell
COMMENTS= 

I do not have any other filetypes to experiment on (flac?...) but we would have to at least internally manage ID3 frame names vs vobis comments etc

---Fran

On Sat, 2 May 2020 at 04:41, Yoni Rabkin <[hidden email]> wrote:
"Fran Burstall (Gmail)" <[hidden email]> writes:

> pyprinttags fails to provide playing-time which emms-print-metadata
> does get by querying TagLib::AudioProperties.
>
> Is this a show-stopper?

I've just had a look at python-mutagen, which installs
mutagen-inspect. It's output on my machine looks like this (ignoring the
non-standard PRIV tag):

-- /home/yrk/audio/classical/Verdi__La_Traviata__Netrebko/01 - Prelude - Prelude.mp3
- MPEG 1 layer 3, 256000 bps (CBR?), 44100 Hz, 2 chn, 216.93 seconds (audio/mp3)
APIC= (image/jpeg, 205990 bytes)
COMM==eng=Amazon.com Song ID: 204947184
TALB=Verdi: La Traviata
TCOM=Giuseppe Verdi
TCON=Classical
TCOP=(C) 2005 Deutsche Grammophon GmbH, Hamburg
TDRC=2005
TIT2=Prelude - Prelude
TPE1=Wiener Philharmoniker
TPE2=Anna Netrebko
TPE3=Carlo Rizzi
TPOS=1/2
TRCK=1/22

Do you see mutagen-inspect from python-mutagen as a candidate?

>     >   
>      *************************************************************************
>     >     TAGS OF '02. Peter Gunn (live) _ Where's Your Head At
>     >     (Head-a-Pella).mp3'
>     >   
>      *************************************************************************
>     >     ALBUM                             = As Heard on Radio
>     Soulwax,
>     >     Part 2
>     >     ALBUM ARTIST CREDIT               = 2 Many DJ’s
>     >     ALBUMARTIST                       = 2 Many DJ’s
>     >     ALBUMARTISTSORT                   = 2 Many DJ’s
>     >     ARTIST                            = Emerson, Lake & Palmer
>     /
>     >     Basement Jaxx
>     >     ARTIST CREDIT                     = Emerson, Lake & Palmer
>     /
>   
>     [snip]
>   
>     I got something like this:
>   
>     ************************************
>     TAGS OF '01 - Prelude - Prelude.mp3'
>     ************************************
>     ALBUM       = Verdi: La Traviata
>     COMMENT     = Amazon.com Song ID: 204947184
>     COPYRIGHT   = (C) 2005 Deutsche Grammophon GmbH, Hamburg
>     CONDUCTOR   = Carlo Rizzi
>     ARTIST      = Wiener Philharmoniker
>     TITLE       = Prelude - Prelude
>     GENRE       = Classical
>     ALBUMARTIST = Anna Netrebko
>     COMPOSER    = Giuseppe Verdi
>     DATE        = 2005
>     TRACKNUMBER = 1/22
>     DISCNUMBER  = 1/2
>     Unsupported tag elements: PRIV; APIC
>   
>     ...which looks easy enough to parse.
>   
>     Unfortunately, installing pytaglib on my Trisquel machine was as
>     much
>     work as emms-print-metadata. It involved manually downloading
>     pytaglib-0.3.4, then installing cython, then:
>   
>     $ python setup.py build
>     $ python setup.py install --user
>   
>     But I assume that it is easier on systems with pip, so this isn't
>     a
>     show-stopper. Moreover, it shows that this can run on a
>     completely free
>     system. If it couldn't then that would be another show-stopper.
>   
>     As an aside: looking at the command line of pyprinttags I note
>     that
>     we'll have to add the "-b" (batch) option so that pyprinttags
>     doesn't
>     try to ask the user questions and hang the elisp process call.
>   
>     > Clearly a little parsing would be necessary to get this into a
>     shape
>     > that emms could work with.
>     >
>     > I see two ways to go with this:
>     >
>     > 1.  write emms-info-pytaglib.el which does the parsing.
>     >
>     > 2.  write a python version of emms-print-metadata that is a
>     drop-in
>     > replacement for the C version.
>     >
>     > Both are easy though option 2 is probably easier.  The downside
>     of
>     > option 2 is that we still have a piece of non-elisp to install
>     in the
>     > user's path.
>     >
>     > Preferences?
>   
>     Absolutely option 1, since otherwise we would be shipping C, C++,
>     Perl,
>     and Python; no thank you. The idea is to let the OS provide the
>     packages, and let elisp do the rest. This is as opposed to what
>     we do
>     now, which is: let the OS provide a package, provide some glue
>     code, and
>     then let elisp do the rest. We are trying to get rid of the glue.
>   
>     I can write an implementation of emms-info-pytaglib and ping you
>     to test
>     it once I'm done, or you can do that. It really depends on
>     whether you
>     feel like writing that would be fun for you; your choice. Thank
>     you
>     nevertheless.
>   
>     --
>        "Cut your own wood and it will warm you twice"
>
>
>

--
   "Cut your own wood and it will warm you twice"
Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Yoni Rabkin-2
"Fran Burstall (Gmail)" <[hidden email]> writes:

> I have just pushed emms-info-tinytag.el onto the master branch.

That was fast!

> As discussed previously, this is a emms-info method that works out of
> the box using the python module tinytag.
>
> Good points:
>
> * it works!  (At least for me)
>
> Less good points:
>
> * It is slow, compared to emms-info-libtag.  The emms-info-tinytag
> takes about 16 mins to build the cache of my 13,000 mp3s with a few
> flac, ogg and m4a thrown in while emms-info-libtag takes about 9
> minutes.

It is indeed slower, but not terribly so.

> * It is less featureful: tinytag cannot handle dates beyond years (no
> exact release dates) and does not support original[year,date] or the
> performer tag or sort-order tags.

I didn't have any significant issues here.

> While looking into other possibilities, I came across another, perhaps
> surprising, candidate which looks like it might make a good
> alternative: exiftool, a perl script aimed at tagging photos, has a
> surprising good tag reader for audio in almost as many formats as
> taglib or tinytag.  Certainly it has performer and sort-order tags and
> can handle full dates..  If there is interest, I will look into making
> an info source based on that.

I just checked exiftool and it returned good information for flac, ogg
and mps. What a brilliant and unexpected find. Thank you for unearthing
this.

We should absolutely add an info source for exiftool. But don't feel
that you have shoulder that as well. If you feel like doing it, go
ahead, but otherwise I'll pick that up.

> In any case, please experiment with emms-info-tinytag.el.

I edited the copyright header on it, but otherwise it's a keeper. I'll
document it in the manual.

> It works for me but I am a mathematician not a programmer!

I consider programming to be calcified math anyway.

>
>
>
>
>
>
> On Mon, 4 May 2020 at 01:27, Yoni Rabkin <[hidden email]> wrote:
>
>     "Fran Burstall (Gmail)" <[hidden email]> writes:
>    
>     >     If you are the person doing the coding, I have no problem
>     with
>     >     you
>     >     choosing either tinytag or mutagen. The person doing the
>     actual
>     >     work
>     >     gets a say. If we hit a wall when testing one, we'll just
>     switch
>     >     to the
>     >     other.
>     >
>     >
>     > OK.  Expect to see emms-info-tinytag.el within a couple of
>     weeks
>     > then...
>    
>     excellent
>    
>     take your time
>    
>     --
>        "Cut your own wood and it will warm you twice"
>
>
>

--
   "Cut your own wood and it will warm you twice"

Reply | Threaded
Open this post in threaded view
|

Re: looking forward to Emms 6.0

Petteri Hintsanen-2
In reply to this post by Yoni Rabkin-2
Yoni Rabkin <[hidden email]> writes:

> * Find a suitable replacement for emms-print-metadata as a way to access
>   taglib. A current candidate is installing pytaglib.

I have been playing with a bit orthogonal solution to this, namely
writing a native elisp implementation to extract tags from Ogg Vorbis
files and feed them to EMMS.  Please find a prototype attached.  It is
really just a proof-of-concept code, but it does the job and is
surprisingly efficient: throughput seems to be around 30 files per
second.  I have a bit less than 3000 ogg files and it takes about 1 min
20 sec to parse all of them.  (Be aware that this is an extremely
unscientific benchmark.)

It would be straightforward to extend the code to handle Opus and maybe
even ID3v2 (MP3).  Then we could have a native parser for common free
formats and dispatch other formats (or otherwise unparseable files) to
third-party tools like exiftool.

What do you think?

Thanks,
Petteri


vorbis-comment.el (3K) Download Attachment