Comments (7)
Thank you so much Dennis! your support is awesome I definitely try it
from dswaveformimage.
Hey, yeah Xcode 14.2 is not supported currently with the latest version. I think 13 was the last one where it was, maybe even 12.
so the solution would be to update to latest Xcode 15.x (15.2 is the current one at this point).
is that an option for you, or why are you still on Xcode 14?
from dswaveformimage.
Ok, yeah I'm using Xcode 14 becuase I'm using MacBook Pro 2015 and macOS 12 is the last version for it so I can't update to macOS 13/14 and Xcode 15
from dswaveformimage.
Hmm ok, that’s of course a good reason. If I’m not mistaken though, isn’t Xcode 15 required (soon?) to publish to the AppStore though anyway? Or will Xcode 14 keep being supported for a longer time?
I suppose there should be another way to do the visionOS checks backwards compatible… just not sure right now how. I’d have to check for that.
from dswaveformimage.
Hmm ok, that’s of course a good reason. If I’m not mistaken though, isn’t Xcode 15 required (soon?) to publish to the AppStore though anyway? Or will Xcode 14 keep being supported for a longer time?
I suppose there should be another way to do the visionOS checks backwards compatible… just not sure right now how. I’d have to check for that.
My app can't submit to the AppStore because I'm using Apple private framework.
I don't know about Xcode 15 required but I also have M1 Pro so I don't want to make you hard work
Can we talk on email or twitter (@avirok1)?
Thank you for your quick replay and help
from dswaveformimage.
Sure, happy to continue conversation on twitter. Seems like I can't message you there however due to your privacy settings. I'm @dmrschmidt there, too.
So, I'm now finally on my laptop and wanted to have a closer look at the issue. And I guess I was simply led astray by the warning in the first screenshot. That doesn't actually cause the problem. The issue is, that WaveformImageView
is iOS only. For macOS, the only currently supported utility views are SwiftUI. That's because WaveformImageView
inherits from UIImageView
. I'm not a macOS developer myself, so not sure what the equivalent there would be, but I assume that the approach would be equally straightforward for a lightweight subclass of NSImageView
.
So all things considered, depending on your use case, I'd suggest you either just use images with WaveformImageDrawer
directly, or you add your own small convenience NS[Image]View
subclass around it. I wouldn't be surprised if the code translates almost 1:1 with only replacing UI
for NS
prefixes. If you have a look at WaveformImageView
, it's really just a dead simple wrapper.
If your app requires any scrolling etc, it's not a great choice anyway, as it's not handling any caching and whatnot. It's designed to be a quick drop in for the majority of simple cases. Any more sophisticated use cases in table or scroll views etc should be implemented with WaveformImageDrawer
.
from dswaveformimage.
Following up on our twitter conversation, to simulate a basic "speech sensitive" view, you could go with something like the following.
You need a WaveformRenderer
that ignores the lastOffset
to avoid the waveform from scrolling as new samples come in. This can be done easily via composing the existing LinearWaveformRenderer
like so:
struct StaticWaveformRenderer: WaveformRenderer {
let baseRenderer = LinearWaveformRenderer()
func path(samples: [Float], with configuration: Waveform.Configuration, lastOffset: Int, position: Waveform.Position) -> CGPath {
return baseRenderer.path(samples: samples, with: configuration, lastOffset: 0)
}
func render(samples: [Float], on context: CGContext, with configuration: Waveform.Configuration, lastOffset: Int, position: Waveform.Position) {
baseRenderer.render(samples: samples, on: context, with: configuration, lastOffset: 0)
}
}
Then all you need is to use that one in a narrowed-down WaveformLiveCanvas
with strong damping on both side, like so:
WaveformLiveCanvas(
samples: samples,
configuration: configuration.with(damping: .init(percentage: 0.4, sides: .both)),
renderer: StaticWaveformRenderer(),
shouldDrawSilencePadding: true
)
.frame(width: 48, height: 32)
This will result in something like I'd already shared with you:
Screen.Recording.2024-01-14.at.10.03.15.2.mov
from dswaveformimage.
Related Issues (20)
- xcode 15 not support. Stored properties cannot be marked unavailable with '@available' HOT 1
- Striped style with gradient HOT 2
- Stored properties cannot be marked unavailable with '@available' HOT 3
- Stored properties cannot be marked unavailable with '@available' HOT 1
- Thread 1: EXC_BAD_ACCESS (code=2, address=0x2829857c4) HOT 1
- WaveForm Flickering HOT 2
- Extra argument position in call error in MacOS HOT 1
- I need to show loader till complete image generating from audio URL. HOT 2
- Update version in cocoapod HOT 2
- crash in iOS 17 HOT 10
- WaveformLiveCanvas with live floats from AVAudioPCMBuffer.floatChannelData always indicating max volume, not showing silence HOT 7
- Can't Run Example HOT 3
- LTR Support HOT 1
- Getting crash While entering foreground from background HOT 23
- unable to create wave view with audio server url HOT 1
- Stored properties cannot be marked unavailable with '@available' HOT 4
- Android alternative HOT 1
- Support for stereo/multiple channels HOT 1
- Support for older versions of macOS HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dswaveformimage.