gyetvan-andras / cocoa-waveform Goto Github PK
View Code? Open in Web Editor NEWA cocoa audio player component which displays the waveform of the audio file.
A cocoa audio player component which displays the waveform of the audio file.
Hello,
I have NSData representation of some audio files.. Can I still use this extension?
Thanks..
Matt
Can this control display waveform from music in iTune library? I have try but it's have some error that I don't know what it's came from.
I just tested out cocoa-waveform -- very cool.
I'm working on a special needs app for kids with autism for iPad and iPhone. I'd love to drop-in your viewer/player but I see there is a fair amount of Mac-specific coding in the current implementation.
I thought I'd ask to see if you were planning on bringing this over to iOS -- any plans?
Mike
The Xcode Instruments show leaks in string:
error = AudioFileGetProperty(afid, kAudioFilePropertyInfoDictionary, &size, &info);
Trying to run the iOS app in Xcode just crashes.
Hi, me again...
I'm trying to understand why you're 'chunking' the reading of the samples from the audio file instead of just doing it all at once(?) Is it to account for a situation where the sound file might be extremely long, and thus exceed the available memory on the device?
Thanks again!
Hello again,
Thank you very much for your answer. It was very helpful for me and now I can use your lovely tool in my app.
One little question.
If I want to stop playing the sound programmatically without to press pause button how can I do it?
Also I get a warning which is :
ARC Retain Cycle
"Capturing 'self' strongly in this block is likely to lead to a retain cycle"
Can you take care about that?
Thank you in advance
George N. Gerardis
Hi, this sample is really useful, so thank you for submitting it!
I've noticed that when using short audio files (e.g. 5 seconds) the waveform resolution is not so good, it results in large "chunks" in the waveform rather than detailed peaks.
I've tried to play with the parameters in the drawRect method as you suggested, including CGContextSetLineWidth and CGContextSetLineCap, but I can't get it to change. Can you help?
Many thanks!
Hello,
First of all I would like to thank you for this nice and interesting tool.
One recommentation.....
Can you enhancement your tool to work with caf AAC sound files in ios Except only MP3 ones?
Thank you in advance
George N. Gerardis
Not a huge deal, but I figured I'd bring it up.
When you are done listening to a sound clip, the audio stops and the button returns to 'play'. When you click on play though, it starts playing after the sound file.
For example, the app says 2:55/2:55 when the sound file is done playing. If play is pressed again, time will increase at that interval - 2:55/2:56, 2:55/2:57, so on so forth.
- Could be fixed on line 145 by replacing with this:
if(player.rate == 0.0 && (CMTimeGetSeconds(player.currentTime)/CMTimeGetSeconds(player.currentItem.duration)) < 1.0)
EDIT: Also found: Before you load a sound, there is nothing where the play/pause is. That would be fine, however you can still click on it and the green text says 'playing'.
These behaviors occurs in the iOS version, not the OSX version.
Thanks
Looks like a great project but I'm scared to download it because the license is not clear. There are copyright notices in the code with All Rights Reserved so this code clearly can't be used in a project without the author having the ability to claim illegal use of the code. Please add a LICENSE.
Hello!
Thank you very much for sharing this code. I'm still fairly new to programming and am struggling to understand what's happening inside the dataForResolution:lenght method. I think all the nested loops are confusing me.
I've compared the samples stored in the WaveSampleProvider's normalizedData array with the samples returned by dataForResolution:lenght: in sd and they're identical (I'm using a very short, 2 second, piece of audio).
What is the pixelWide argument?
What is the rangeLength variable? and why do you add 1 to pixelWide in the denominator?
Update:
Spending more time with this I think I get it...
In the case where we have more samples in our array than we have points/pixels to draw on the screen, to draw them we need to scale the number of samples down to fit the resolution of the area being drawn to. dataForResolution:: is performing that scaling.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.