← Back to team overview

audio-recorder team mailing list archive

Re: Audio-recorder: Metadata problem: Length of audio recording is not always correct

 

Re-hi,

We may keep the long file name. We simply remove all unusual characters,
like ",`()[]...." from it.
The following code change will give Yvonne`s song a title:

"If I Can t Have You  Originally Performed by Yvonne Elliman   Karaoke
Version .mp3"

Looks ok?
-----

Module: src/gst-recorder.c, function rec_create_filename(...).

static gchar *rec_create_filename(gchar *track, gchar *artist, gchar
*album) {
    // Note: we are not using album name here. Maybe in the next version.

    gchar *file_name = NULL;

    // Do we have a track name?
    if (str_length(track, NAME_MAX) < 2) {
        // No.
        // Auto-generate a new file name from the date+time pattern
        return rec_generate_unique_filename();
    }
    // Length of track name is > NAME_MAX - 5 bytes?
    // For example youtube video ids are very long.
    else if (str_length(track, NAME_MAX) > (NAME_MAX - 5)) {
        // Auto-generate a new file name from the date+time pattern
        return rec_generate_unique_filename();
    }
...
...

Osmo Antero
Palmela/Portugal

On Sat, Nov 18, 2017 at 1:30 PM, Osmo Antero <osmoma@xxxxxxxxx> wrote:

> Re-hello,
>
> Yes, the debug info shows that one of the Yvonne`s songs has a peculiar
> and long title.
>
> The first version of the song has a very long filename with special
> characters like "()[]".
> Its title is: "If I Can't Have You (Originally Performed by Yvonne
> Elliman) [Karaoke Version]".
> See the "*xesam:title" *tag below.
>
> Audio-recorder thinks that this is not a valid song title.
>
> Debug info from dbus-mpris2.c module:
>
> Metdata key "mpris:trackid" has type:s and value:'spotify:track:
> 1H7ZHs5m4YnN8fZ9e47H8i'
> Metdata key "mpris:length" has type:t and value:uint64 200785000
> Metdata key "mpris:artUrl" has type:s and value:'https://open.spotify.
> com/image/7fba57d7a4de4d20fec9b24d5b2e578db3af80c5'
> Metdata key "xesam:album" has type:s and value:"The Karaoke Channel - Sing
> If I Can't Have You Like Yvonne Elliman"
> Metdata key "xesam:albumArtist" has type:as and value:['The Karaoke
> Channel']
> Metdata key "xesam:artist" has type:as and value:['The Karaoke Channel']
> Metdata key "xesam:autoRating" has type:d and value:0.0
> Metdata key "xesam:discNumber" has type:i and value:1
> Metdata key "*xesam:title*" has type:s and value:"If I Can't Have You
> (Originally Performed by Yvonne Elliman) [Karaoke Version]"
> Metdata key "xesam:trackNumber" has type:i and value:1
> Metdata key "xesam:url" has type:s and value:'https://open.spotify.
> com/track/1H7ZHs5m4YnN8fZ9e47H8i'
> ----------------------------
>
> The other version Yvonne`s song produces a valid filename.
> Its title is: "If I Can't Have You".
> See the "*xesam:title" *tag below.
>
> Debug info from dbus-mpris2.c module:
>
> Metdata key "mpris:trackid" has type:s and value:'spotify:track:
> 0WLJgHmiCindTn3QMjyzg6'
> Metdata key "mpris:length" has type:t and value:uint64 179471000
> Metdata key "mpris:artUrl" has type:s and value:'https://open.spotify.
> com/image/7fba57d7a4de4d20fec9b24d5b2e578db3af80c5'
> Metdata key "xesam:album" has type:s and value:"The Karaoke Channel - Sing
> If I Can't Have You Like Yvonne Elliman"
> Metdata key "xesam:albumArtist" has type:as and value:['The Karaoke
> Channel']
> Metdata key "xesam:artist" has type:as and value:['The Karaoke Channel']
> Metdata key "xesam:autoRating" has type:d and value:0.0
> Metdata key "xesam:discNumber" has type:i and value:1
> Metdata key "*xesam:title*" has type:s and value:"If I Can't Have You"
> Metdata key "xesam:trackNumber" has type:i and value:2
> Metdata key "xesam:url" has type:s and value:'https://open.spotify.
> com/track/0WLJgHmiCindTn3QMjyzg6'
> ----------------------------
>
> Albert-Jan, what do you suggest we do with the long title?
> How can we produce a valid song title from it.
> Should we simply skip the special characters like ()[] and use the result?
>
> Até logo.
> Cumprimentos
> Osmo Antero
> Portugal
>
>
>
> On Fri, Nov 17, 2017 at 9:31 AM, Albert-Jan Scholtalbers <
> ajc.scholtalbers@xxxxxxxxx> wrote:
>
>> Hi Osmo Antero,
>>
>> Thanks for your replay, extensive explanation and willingness to help. It
>> feels 10x better than my doctor, who I have to pay E200,/hr ;)
>>
>> Further investigation made it clear that audio lengths of files only seem
>> to be in issue in Libreelec/Kodi where I played the results.
>> So not:
>> - Audacious [Lubuntu default audio player]
>> - VLC
>> I tested it on the same system I use audio recorder.
>>
>> So I guess the problem lies within LibreElec/Kodi [I'm using an older
>> version due to passthrough functionality].
>>
>>
>> *I do see another issue.*
>> From some songs from Spotify the name capturing fails, resulting in
>> default name YYYY-MM-DD-HH:MM:SS.extension
>> Like Yvonne Elliman - If I can't have you. See link to song
>> <https://open.spotify.com/track/1tsWNtWxi7SVydMm2G1W6Z>
>>
>> Can I report that issue here. And what should I provide to you [logs] so
>> you can have an attempt to solve this?
>>
>> Best regards,
>>
>> Albert-Jan
>>
>>
>>
>>
>>
>> 2017-11-16 21:32 GMT+01:00 Osmo Antero <osmoma@xxxxxxxxx>:
>>
>>> Hello,
>>> You have an interesting issue.
>>>
>>> Audio-recorder uses Gstreamer and Gstreamer pipelines to do the
>>> recording job. We have to  debug the actual pipeline and check what causes
>>> the wrong time length.
>>>
>>> 1) Let us get & reveal the Gstreamer pipeline. Do this:
>>> Start audio-recorder and goto [Additional settings] dialog.  Then select
>>> the "Recording commands" tab.
>>> Then click the [Show Cmd] button to reveal the Gstreamer pipeline
>>> (recording command).
>>>
>>> 2) Start a gnome-terminal window (press Cntrl + T) and copy/paste the
>>> Gstreamer pipeline to the terminal window.
>>> You may need to install the "gstreamer1.0-tools" package first.
>>> $ sudo apt install gstreamer1.0-tools
>>>
>>> Play some music and test the pipeline. Replay and check the resulting
>>> output file.
>>>
>>> We must find out where and why the Gstreamer pipeline fails to set right
>>> time and length.
>>>
>>> Tell about your findings.
>>>
>>> //Osmo Moma Antero
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Nov 16, 2017 at 11:31 AM, Albert-Jan Scholtalbers <
>>> ajc.scholtalbers@xxxxxxxxx> wrote:
>>>
>>>> Hi there,
>>>>
>>>> Didn't get the bug reported via website ???? launchpad :(
>>>>
>>>> When you backup music via audio recorder from Spotify the lenght of the
>>>> recording is not always correct. That is the length of the recording shown
>>>> in a software audio player, playing afterwards the made recording.
>>>>
>>>> Example:
>>>> When you take Dolly Parton - Island in the stream in Spotify. It will
>>>> give you length of 22:10
>>>> The actual length of the recording is 4:08.
>>>> The played mp3 stops playing after 4:08 and is ready for new song.
>>>>
>>>> Experience problems in:
>>>> - Latest version of Elemetary OS [audio recorder 1.7.5]
>>>> - Lubuntu 17.10 [audio recorder 2.0.2]
>>>>
>>>> So easy to reproduce.
>>>>
>>>> If you need more info, let me know.
>>>>
>>>>
>>>> Description:    Ubuntu 17.10
>>>> Release:    17.10
>>>> Audio Recorder 2.0.2
>>>>
>>>>
>>>> Henk
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Mailing list: https://launchpad.net/~audio-recorder
>>>> Post to     : audio-recorder@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~audio-recorder
>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>
>>>
>>> --
>>> Sent from my PC, laptop or phone with Ubuntu-Linux.
>>>
>>
>>
>
>
> --
> Sent from my PC, laptop or phone with Ubuntu-Linux.
>



-- 
Sent from my PC, laptop or phone with Ubuntu-Linux.

References