Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

waveform fit width? #52

Closed
AndrewSB opened this issue Nov 28, 2022 · 10 comments
Closed

waveform fit width? #52

AndrewSB opened this issue Nov 28, 2022 · 10 comments

Comments

@AndrewSB
Copy link

both with the WaveformView and WaveformLiveView, theres a bunch of space on the left or right if the audio file / number of samples isn't long enough. is there some way to have the waveform fit width?

Screenshot 2022-11-28 at 12 52 24 PM

@dmrschmidt
Copy link
Owner

Hmm... For WaveformView it should actually scale correctly to the full width. How long is that audio file? Does it have silence at the end? Could you share the audio maybe, so I could have a look? Definitely doesn't look correct, no.

For the WaveformLiveView the answer I'm afraid for now is "not really possible, no". It would require constant dynamic downsampling, which is quite compute intensive, so it would require to also make use of Accelerate operations. Doable of course, but not currently in scope for me to do.

Apart from that technical side, it's also currently intended for a different use case, which is more to show "time progress" during recording, rather then present the entire recording in one view. So it's designed to be used in places like a voice message recording a la WhatsApp, etc where the waveform "scrolls". I don't think I'd want to change that currently.

@AndrewSB
Copy link
Author

keeping the scrolling live view is seems like a fine direction, but i'm surprised that the file doesn't fit width

@dmrschmidt
Copy link
Owner

This is what that same audio file looks like when it is imported into Ableton:

Screenshot 2022-11-28 at 19 21 28

So there must be something strange about the audio file itself.

It looks like its taking up half the space than it should. Which makes me think it does sth like saying it's stereo when it's in fact mono, or claims to have a different sample rate than it actually has or sth. along those lines.

Given that Ableton renders it in the exact same way, I'm inclined to treat the audio file as buggy. I'm still curious what's going on here, but it looks low priority to me?

@dmrschmidt
Copy link
Owner

Hey @AndrewSB, I wanted to have another look at the file, to understand what the issue with it is. I'm still quite sure the issue is with the file itself and not the library, but I'd like to understand exactly how the file is weird to make sure there's not some other potential issue that may come up later for files like that.

Unfortunately the link you had pasted doesn't work anymore. Do you still have a copy of it lying around anywhere?

And did you maybe figure out what was wrong with it? Which app / encoder / etc. actually created it originally?

@AndrewSB
Copy link
Author

for sure! i was downloading it using ytdl from youtube, with one of the highest quality audio options. m4a i think

https://youtu.be/Z0Uh3OJCx3o is the video

@AndrewSB
Copy link
Author

let me know what it is, if you figure it out! i'm curious too

@dmrschmidt
Copy link
Owner

Thanks! If I google ytdl it's giving me tons of things that don't look like what you probably used. Do you have a URL?

@AndrewSB
Copy link
Author

AndrewSB commented May 16, 2023

found the audio file i was testing with!

victory-royale.mp4

@dmrschmidt
Copy link
Owner

Thanks for sharing. So I had another look at it. I'm not intimately familiar enough with the mp4 format to figure out what exactly the problem is with the file, but it definitely has a defect, which passing it to multiple other audio apps confirmed.

So I'll just file this as "mysterious bug in ytdl" and close this issue. Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants