Recent

Author Topic: Output Sound  (Read 14724 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3304
    • StrumPract is the musicians best friend
Re: Output Sound
« Reply #15 on: February 18, 2024, 04:20:29 pm »
Hello Jipete.

You are right, the demos are old and I did not check it for a long time ago.
I have to retest all, mainly the LCL-Lazarus demos, I will do it asap.
But uos is up-to-date, here a project using all the features in /uos/examples and more:
https://github.com/fredvs/strumpract/releases/

Please, for help and problems about uos, use uos-forum:  http://uos-forum.108.s1.nabble.com
Fre;D

[EDIT] It seems that the binary of libsndfile.so from /uos/exapmple/lib is not accepted by your system.
You may try to load the libraries installed in your system vs the one given in uos package with this:

Change this:
Code: Pascal  [Select][+][-]
  1. res := uos_LoadLib(PChar(PA_FileName), PChar(SF_FileName), PChar(MP_FileName), nil, nil, nil); // Error

With this:
Code: Pascal  [Select][+][-]
  1. res := uos_LoadLib(PChar(PA_FileName), 'system', PChar(MP_FileName), nil, nil, nil);

or for all libraries from system:

With this:
Code: Pascal  [Select][+][-]
  1. res := uos_LoadLib('system', 'system','system', nil, nil, nil);

Hum, bad news that libsndfile.so of uos package is no more compatible with old Debian releases.
I have to compile it and test it on other systems.

@Thaddy: You are right about the latency if you use the api-windows.
But if you have installed ASIO4All, PortAudio can deal with it, just select ASIO as device.

Fre;D
« Last Edit: February 18, 2024, 08:57:23 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3304
    • StrumPract is the musicians best friend
Re: Output Sound
« Reply #16 on: February 18, 2024, 06:04:57 pm »
Re-hello Jipete.

OK, I did check on older Ubuntu system and indeed the new version of libSndFile.so provided in /uos/examples/lib does not load on older Debian system.
So I restored previous version who is more "universal" and works perfectly.

Could you try with last commit of uos?

Thanks to note it.

[EDIT]  I know why the last version of LibSnfile.so was not working.
LibSndfile.so link to libc.so.6, but, (like some others  ;) ), did not use symbol versioning for linking, even using old table of glibc.
(Maybe some people here know what I mean... O:-) )

Fre;D

« Last Edit: February 18, 2024, 09:24:17 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

jipété

  • Full Member
  • ***
  • Posts: 176
Re: Output Sound
« Reply #17 on: February 19, 2024, 08:12:16 am »
Hello,

But uos is up-to-date, here a project using all the features in /uos/examples and more:
https://github.com/fredvs/strumpract/releases/
ootb, that project doesn't play my regular .wav files : a five minute song is played in second with totally distorded song.

Could you try with last commit of uos?

Thanks to note it.
Regarding simpleplayer.lpi, the test.ogg coming with the package is ok but the program doesn't work with regular .wav files, it's the same problem as strumpract, even after using 'system', 'system', 'system',
Same problem with formspectrum.
Same problem with waveform and no waveform displayed.

[EDIT]  I know why the last version of LibSnfile.so was not working.
LibSndfile.so link to libc.so.6, but, (like some others  ;) ), did not use symbol versioning for linking, even using old table of glibc.
Maybe, but so, why simpledrums works fine ?

Regards,

domasz

  • Hero Member
  • *****
  • Posts: 527
Re: Output Sound
« Reply #18 on: February 19, 2024, 08:20:29 am »
.WAV is not a format but a container. Inside can be multiple different formats, even MP3. If you post your WAV we might find a problem.

jipété

  • Full Member
  • ***
  • Posts: 176
Re: Output Sound
« Reply #19 on: February 19, 2024, 09:42:11 am »
.WAV is not a format but a container. Inside can be multiple different formats, even MP3.
even BMP, JPG and so on, yes, I know.

If you post your WAV we might find a problem.
too big for the forum.
Anyway, the file in test which brokes uos-simpleplayer works fine with audacious, mpv, smplayer, audacity, and players written with Lazarus and BASS.

OK, there is something strange : I open that file in Audacity and I remove one second at the beginning then starting from the end I remove all but 2 seconds of song and I export the result to a new song, which is now opened gracefully in uos-simpleplayer.

Last test, which drives me nut : I open the problematic file in Audacity and, changing nothing, I export it somewhere and simpleplayer now is happy !
Does it mean that I have to modify all my files ?   :(
it will be much faster to remove uos stuff, sorry, Fred...

domasz

  • Hero Member
  • *****
  • Posts: 527
Re: Output Sound
« Reply #20 on: February 19, 2024, 09:48:12 am »
This sounds like when exporting it saved in a different format. You should compare formats of the WAV files (khz, bps, codec etc).

jipété

  • Full Member
  • ***
  • Posts: 176
Re: Output Sound
« Reply #21 on: February 19, 2024, 09:53:00 am »
While you were writing, it was what I did :
bad  file uses 44 793 934 bytes ("bad" from the point-of-vue of uos)
good file uses 89 587 888 bytes

Anyway, seen in Audacity, both files are identical : Stereo, 44100 Hz, float 32 bits.

And I don't know how to compare codecs...

domasz

  • Hero Member
  • *****
  • Posts: 527
Re: Output Sound
« Reply #22 on: February 19, 2024, 09:58:45 am »

jipété

  • Full Member
  • ***
  • Posts: 176
Re: Output Sound
« Reply #23 on: February 19, 2024, 10:19:38 am »
https://en.wikipedia.org/wiki/MediaInfo
should do the job
Thanks a lot, you are right !

BAD (as seen by uos) :
Audio
Format                                   : PCM
Format settings                          : Little / Signed
Codec ID                                 : 1
Duration                                 : 4 min 13 s
Bit rate mode                            : Constant
Bit rate                                 : 1 411.2 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Bit depth                                : 16 bits
Stream size                              : 42.7 MiB (100%)

GOOD :
Audio
Format                                   : PCM
Format profile                           : Float
Codec ID                                 : 3
Codec ID/Hint                            : IEEE
Duration                                 : 4 min 13 s
Bit rate mode                            : Constant
Bit rate                                 : 2 822 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Bit depth                                : 32 bits
Stream size                              : 85.4 MiB (100%)


The culprit is Audacity, which doesn't show the values of the "bad" file...

End of story, still looking for a level meter...

Fred vS

  • Hero Member
  • *****
  • Posts: 3304
    • StrumPract is the musicians best friend
Re: Output Sound
« Reply #24 on: February 19, 2024, 12:21:43 pm »
Hello Jipete.

Strange the problem with your wav file, I really want to discover where is the problem.

Audacity uses also libsndfile for wav format.
Is it absolutely not possible to share your bad audio file?
If no, from where did you get this file, was it from recording and from what recorder?

Quote
Anyway, seen in Audacity, both files are identical : Stereo, 44100 Hz, float 32 bits.

Hum, strange because MediaInfo says that the 'bad' file is integer 16 bits and the 'good' is float 32 bits.
If you have distortion of sound, sure the problem is there.

Quote
still looking for a level meter...

What is a level meter, is it a view-meter (VU) ?
If so, there is a simple in SimplePlayer.

But maybe you are tired of uos, if so, sorry for the noise.

[EDIT] OK, I see now that there is a problem with wav file, here using SimplePlayer and select test.wav file, the sound is distorted.
           I have to make a stock of coffee and jump into it, this was not happening before so a bug was introduced.
           With previous release of uos, the sound of test.wav is ok:
           https://github.com/fredvs/uos/releases/tag/v2220425
           Thanks to show it and I apologize for the problems.
     
Fre;D
« Last Edit: February 19, 2024, 02:58:52 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3304
    • StrumPract is the musicians best friend
Re: Output Sound
« Reply #25 on: February 19, 2024, 02:18:42 pm »
Re-hello Jipete.

OK, things should be fixed with last commit.
I thank you to discover that bad bug.

Here the loading of wav files is back to normal.
I hope that your wav file will be recognized and become good.

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

jipété

  • Full Member
  • ***
  • Posts: 176
Re: Output Sound
« Reply #26 on: February 19, 2024, 03:40:25 pm »
Is it absolutely not possible to share your bad audio file?
If no, from where did you get this file, was it from recording and from what recorder?
No way, I really don't remember from where it came...

Hum, strange because MediaInfo says that the 'bad' file is integer 16 bits and the 'good' is float 32 bits.
If you have distortion of sound, sure the problem is there.
Maybe Audacity set up good data (for him) for export ?

What is a level meter, is it a view-meter (VU) ?
If so, there is a simple in SimplePlayer.
Yes.
Seen, I'll try it.

[EDIT] OK, I see now that there is a problem with wav file, here using SimplePlayer and select test.wav file, the sound is distorted.
           I have to make a stock of coffee and jump into it, this did not append before so a bug was introduced.
           With previous release of uos, the sound of test.wav is ok:
           https://github.com/fredvs/uos/releases/tag/v2220425
           Thanks to show it and I apologize for the problems.
Thanks to you for all these codes.     
img simpleplayer

The last questions, from the last commit :
1- what is the usefulness (still in simpleplayer) of the left three choices (float, int32, int16) ?
If I click one or another I don't hear changes, and opening a 16-bit int file checks the Float32 option...

2- why, at the first run, I see the Tempo cursor moving to "2.0" when I press "Play" (without change on song) ?

3- what is missing, here ?
img warning

Regards,
--
jipété

Fred vS

  • Hero Member
  • *****
  • Posts: 3304
    • StrumPract is the musicians best friend
Re: Output Sound
« Reply #27 on: February 19, 2024, 05:49:17 pm »
Hello Jipete.

Quote
1- what is the usefulness (still in simpleplayer) of the left three choices (float, int32, int16) ?

uos can deal with those 3 formats of sample.  When selecting one of that format, uos will convert the original sample into that format.
Maybe you will not no hear difference with the samples without effects but when applying DSP effects to the samples, like fournier series, using float format will give better result because integer will need to be rounded at end of calculation.
Also, some audio cards can deal only with integer samples.

Quote
2- why, at the first run, I see the Tempo cursor moving to "2.0" when I press "Play" (without change on song) ?

Hum, it is a preset to 2X the tempo. If you enable "Enable SounTouch Plugin" it will apply a DSP to change the tempo of the song with that value,
But, yes, maybe setting the tempo 2X at init is not nice, thank to note it, I will remove it.

Quote
3- what is missing, here ?

Nothing, it is a warning to tell that the result of the function is not used.
Indeed, function DSPReverseBefore dont touch to the array of samples, only to the position of the song.
function DSPReverseBefore uses the type of function accepted by uos_InputAddDSP() (see source).
And it can be that the result of the function is not used, like in that case.
In this example of DSP, Playing reverse effect jump to previous position of array of samples (DSPReverseBefore) and reverse order of samples after jump (DSPReverseAfter) and here use the result of the function.

Does the last commit fix your "bad" wav file?

Fre;D
« Last Edit: February 19, 2024, 06:31:36 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

jipété

  • Full Member
  • ***
  • Posts: 176
Re: Output Sound
« Reply #28 on: February 19, 2024, 06:35:54 pm »
Hello, Fred,

Quote
1- what is the usefulness (still in simpleplayer) of the left three choices (float, int32, int16) ?

uos can deal with those 3 formats of sample.  When selecting one of that format, uos will convert the original sample into that format.
Thanks.

Quote
2- why, at the first run, I see the Tempo cursor moving to "2.0" when I press "Play" (without change on song) ?
But, yes, maybe setting the tempo 2X at init is not nice, thank to note it, I will remove it.
Something like that ? : in the ide,
Code: Pascal  [Select][+][-]
  1. TrackBar4.Position = 50
Quote
3- what is missing, here ?
Nothing, it is a warning to tell that the result of the function is not used.
Thanks.

Quote
Does the last commit fix your "bad" wav file?
Ooohhhh , sorry sorry sorry to forgot your question, yes, it works fine !

Thanks again, best regards.
« Last Edit: February 19, 2024, 06:43:13 pm by jipété »

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: Output Sound
« Reply #29 on: February 20, 2024, 03:08:59 pm »
@Noval

Quote
I'm trying to create a metronome ... on Windows 10.
See here -> GoTo "I've attached the Porting of Metronome ..."
'Metronome' uses MMSystem - Old but maybe matches Your Needs.

If You're happy with a Metronome w/o Source, You may try 'MetroBeat' from BreakoutBox   
It uses 'Portaudio'.
« Last Edit: February 21, 2024, 10:35:53 am by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

 

TinyPortal © 2005-2018