sox-users@lists.sourceforge.net unofficial mirror
 help / color / Atom feed
From: Mikko Olkkonen <molkko@gmail.com>
To: sox-users@lists.sourceforge.net
Subject: Re: Wav to Mp3 leads to an mp3 file that has a longer duration
Date: Thu, 19 Dec 2019 11:52:32 +0200
Message-ID: <CANWtmUDvRnvHgMoTTkG-FcGnw5Yhkq=3yDgrFXV1c-ou-zdn0A@mail.gmail.com> (raw)
In-Reply-To: <CAKy7tYgd3ex-xJ+v6JMbGUUpbi6Y80vKJurhXsLJ=Kzqi0YoTw@mail.gmail.com>

[-- Attachment #1.1: Type: text/plain, Size: 3893 bytes --]

Unfortunately I dont know any tool that guarantees such characteristic. I
have performed some simple sample size transformations with sox. In those
cases, some extra samples were added as reasoned (?) in the sox manual
"Accuracy"-section. I have never seen extra samples added at the beginning
of the output. I think that adding in the beginning is not good practice as
the meaningfull parts of input and output signals are not in sync anymore.
I dont know if some time domain to frequency domain compression algorithms
like mp3 has some understandable justification for adding into the
beginning or is it just an poor and unfortunate design choice.
regards, Mikko


On Wed, Dec 18, 2019 at 11:08 AM Martin Ratinaud <martinratinaud@gmail.com>
wrote:

> Ok thanks Mikko
>
> Maybe I'm doing it wrong but here is my initial request
>
> the number of samples is not really important to me. What does is that the
> compression algorithm does not add data at the beginning of the file, which
> it does now
>
> Do you have any idea how I can achieve that ?
>
> -----------------------------------------------------------------------
> *Martin RATINAUD*
> -----------------------------------------------------------------------
>
>
> On Wed, Dec 18, 2019 at 11:44 AM Mikko Olkkonen <molkko@gmail.com> wrote:
>
>> If those are your requirements why dont you just stick to mp3? If your
>> additional requirements would be that 1) audio quality perception remains
>> OK and 2) number of samples remains intact then I believe that solution is
>> nonexisting. You must relax either compression or quality requirement. My
>> reasoning is as follows: you have a lot of samples in the original audio.
>> If you have all those samples (in any reasonable format) in the output file
>> you have large file again i.e. dont have much compression. In other words,
>> if you want compression you must do more drastic processing e.g. transform
>> the signal from "time domain" to "frequency domain" like mp3 does as far as
>> I know. After such compression there is no any meaningful concept of a
>> "sample" anymore. Thus you can not require that number of samples matches.
>> The fact that sox reports number of samples for mp3 does not change this
>> fact (maybe it should not report number of samples but some concept of a
>> block mp3 uses). I believe that additional difficulty (e.g. the discrepancy
>> you observed when you trimmed your signal) arises from aspects discussed in
>> the sox manual section "Accuracy". regards, Mikko
>>
>>
>>
>> On Wed, Dec 18, 2019 at 6:02 AM Martin Ratinaud <martinratinaud@gmail.com>
>> wrote:
>>
>>> Ok and what would be one that
>>> - compresses the file a lot
>>> - is readable on the web
>>>
>>> Thanks
>>> -----------------------------------------------------------------------
>>> *Martin RATINAUD*
>>> -----------------------------------------------------------------------
>>>
>>>
>>> On Tue, Dec 17, 2019 at 2:50 PM Måns Rullgård <mans@mansr.com> wrote:
>>>
>>>> Martin Ratinaud <martinratinaud@gmail.com> writes:
>>>>
>>>> > Thanks for the tip!
>>>> >
>>>> > What codec should I use then ?
>>>>
>>>> Depends on your needs.  Obviously, you have to use a codec supported by
>>>> whatever is going to read the file.
>>>>
>>>> --
>>>> Måns Rullgård
>>>>
>>> _______________________________________________
>>> Sox-users mailing list
>>> Sox-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/sox-users
>>>
>> _______________________________________________
>> Sox-users mailing list
>> Sox-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sox-users
>>
> _______________________________________________
> Sox-users mailing list
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
>

[-- Attachment #1.2: Type: text/html, Size: 6182 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

      reply index

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11 14:26 Martin Ratinaud
2019-12-11 17:18 ` Jeremy Nicoll - ml sox users
2019-12-12  4:18   ` Martin Ratinaud
2019-12-12 17:05     ` Jeremy Nicoll - ml sox users
2019-12-16  5:10       ` Martin Ratinaud
2019-12-16 11:48 ` Måns Rullgård
2019-12-16 12:02   ` Martin Ratinaud
2019-12-16 13:30     ` Måns Rullgård
2019-12-16 13:36       ` Martin Ratinaud
2019-12-16 17:44         ` Måns Rullgård
2019-12-17 10:04           ` Martin Ratinaud
2019-12-17 10:50             ` Måns Rullgård
2019-12-18  4:00               ` Martin Ratinaud
2019-12-18  7:43                 ` Mikko Olkkonen
2019-12-18  9:06                   ` Martin Ratinaud
2019-12-19  9:52                     ` Mikko Olkkonen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-users

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANWtmUDvRnvHgMoTTkG-FcGnw5Yhkq=3yDgrFXV1c-ou-zdn0A@mail.gmail.com' \
    --to=sox-users@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

sox-users@lists.sourceforge.net unofficial mirror

Archives are clonable: git clone --mirror https://public-inbox.org/sox-users

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.sox
	nntp://ou63pmih66umazou.onion/inbox.comp.audio.sox
	nntp://news.gmane.io/gmane.comp.audio.sox

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git