Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Accelerate.vDSPとSwift Chartsでぶち上がろう!/サイボウズモバイル ...
Search
Kyome (Takuto Nakamura)
December 20, 2023
Programming
0
100
Accelerate.vDSPとSwift Chartsでぶち上がろう!/サイボウズモバイル Meetup 2023.04.20
Kyome (Takuto Nakamura)
December 20, 2023
Tweet
Share
More Decks by Kyome (Takuto Nakamura)
See All by Kyome (Takuto Nakamura)
Swiftで高速フーリエ変換してオーディオビジュアライザーを作る / iOSDC Japan 2024 Day1 Track D
kyome22
3
630
ブラウザアプリを自作してわかったWebViewの扱い方/iOS Meetup in 福岡
kyome22
1
3.2k
iOSのウィジェットでも猫走らせたい / iOSDC Japan 2022 Day2 Unconference
kyome22
3
1.1k
Hacking Xcode Behaviors / macOS native symposium #08
kyome22
2
1.5k
AppKitでお絵描きをしてみよう / macOS native symposium #06
kyome22
2
610
Finder Sync Extension で Mac 向け便利ツールを作ろう / iOSDC Japan 2021
kyome22
6
4.3k
iOS Custom Keyboardsでできること/できないこと/やってはいけないこと / iOSDC Japan 2020 LT
kyome22
3
1.9k
Other Decks in Programming
See All in Programming
Cloud Adoption Framework にみる組織とクラウド導入戦略
tomokusaba
2
550
Jakarta EE as Seen Trough the Lens of the ASF
ivargrimstad
0
270
dbt-ga4パッケージを実業務に導入してみた話
t_tokumaru_feedcorp
0
130
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
650
2024-10-01 dev2next - Observability for Modern JVM Applications
jonatan_ivanov
0
130
ポケモンで考えるコミュニケーション / Communication Lessons from Pokémon
mackey0225
4
180
perl for shell, awk and sed programmers
mackee
1
730
Competitionsだけじゃない! Kaggle Notebooks Grandmasterのすすめ
corochann
2
570
メルカリ ハロ アプリの技術スタック
atsumo
2
820
現場から考えるソフトウェアエンジニアリングの価値と実験
nomuson
1
130
データマイグレーションの成功戦略~サービスリニューアルで失敗しないための実践ガイド~
tkzwtks
8
750
フロントエンドの現在地とこれから
koba04
10
4.6k
Featured
See All Featured
It's Worth the Effort
3n
183
27k
Robots, Beer and Maslow
schacon
PRO
157
8.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
26
4.1k
Being A Developer After 40
akosma
84
590k
A Modern Web Designer's Workflow
chriscoyier
692
190k
BBQ
matthewcrist
85
9.2k
Ruby is Unlike a Banana
tanoku
96
11k
Designing the Hi-DPI Web
ddemaree
280
34k
Become a Pro
speakerdeck
PRO
24
4.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
The Mythical Team-Month
searls
218
43k
Transcript
Kyome αΠϘζϞόΠϧ Meetup in େࡕ 2023/06/16 Accelerate.vDSPͱSwift ChartsͰͿ্͕ͪΖ͏ʂ Mobile Meetup
#cybozu_mobile ࣗݾհ IUUQTLZPNFJP ,ZPNF ,ZPNFTVLF CybozuͰkintoneϞόΠϧͷiOSΛ୲ ۀޮԽOSSϥΠϒϥϦͷ։ൃӡ༻ʹੵۃత झຯͰmacOS͚ͷϢʔςΟϦςΟΞϓϦ։ൃ
#cybozu_mobile Audio Visualizer 🎵
#cybozu_mobile Audio Visualizer 🎵 ԻΛՄࢹԽ͢Δͭ Χοί͍͍ʂʂ
#cybozu_mobile Audio Visualizer 🎵 ԻΛՄࢹԽ͢Δͭ Χοί͍͍ʂʂ ࡞ͬͯΈΑ͏🔨
#cybozu_mobile ࣮ͷํ
#cybozu_mobile 1. ϛϡʔδοΫΞϓϦ͔ΒۂͷϦετΛऔಘ 2. ۂͷ࠶ੜ࣌ʹԻݯσʔλΛऔಘͯ͠దٓՃ 3. ԻݯσʔλΛجʹ SwiftUI Ͱ Audio
Visualizer Λදࣔ ࣮ํ
#cybozu_mobile MediaPlayer Framework Λ͏ MPMediaLibrary.requestAuthorization() ͰϛϡʔδοΫΞϓϦͷ ϥΠϒϥϦͷΞΫηεΛཁٻͰ͖Δ Info.plist ʹ NSAppleMusicUsageDescription
Λهड़͢Δඞཁ͕͋Δ MPMediaQuery.songs().items ͰۂҰཡΛऔಘͰ͖Δ λΠτϧɺΞʔτϫʔΫɺԻݯϑΝΠϧͷύεͳͲ͕ೖखՄೳ ࣮ํɿϛϡʔδοΫΞϓϦ͔ΒۂͷϦετΛऔಘ
#cybozu_mobile ࣮ํɿۂͷ࠶ੜ࣌ʹԻݯσʔλΛऔಘͯ͠దٓՃ ۂ AVFoundation Framework ͷ AVAudioPlayerNode() Ͱ࠶ੜ͢Δ Իݯσʔλ AVAudioNode.installTap(onBus:
bu ff erSize: format: ) Ͱ AVAudioPCMBu ff er ΛऔಘͰ͖Δ Accelerate Framework ͷ vDSP Λར༻ͯ͠ৼ෯εϖΫτϧ RMSʢԻͷฏۉΤωϧΪʔʣΛࢉग़͢Δ ৼ෯εϖΫτϧΛಘΔʹ FFTʢߴϑʔϦΤมʣΛߦ͏
#cybozu_mobile ࣮ํɿۂͷ࠶ੜ࣌ʹԻݯσʔλΛऔಘͯ͠దٓՃ ۂ AVFoundation Framework ͷ AVAudioPlayerNode() Ͱ࠶ੜ͢Δ Իݯσʔλ AVAudioNode.installTap(onBus:
bu ff erSize: format: ) Ͱ AVAudioPCMBu ff er ΛऔಘͰ͖Δ Accelerate Framework ͷ vDSP Λར༻ͯ͠ৼ෯εϖΫτϧ RMSʢԻͷฏۉΤωϧΪʔʣΛࢉग़͢Δ ৼ෯εϖΫτϧΛಘΔʹ FFTʢߴϑʔϦΤมʣΛߦ͏ ֶྗ͕ඞཁ 📐
#cybozu_mobile ࣮ํɿԻݯσʔλΛجʹ SwiftUI Ͱ Audio Visualizer Λදࣔ iOS 16͔Β͑Δ Charts
Framework Λ׆༻͢Δ ંΕઢάϥϑɺάϥϑɺࢄਤΛར༻͢Δ ࢄਤͰɺChartSymbolShape ʹ४ڌͨࣗ͠༝ͳਤܗΛࢦఆͨ͠࠲ඪʹ ϓϩοτͰ͖Δʢˡͱʹ͔͘ڧྗɻແݶͷՄೳੑΛײ͡Δʣ Charts ొҎલ Path Canvas (GraphicsContext) Λར༻ͯ͠ άϥϑΛࣗલ࣮͠ͳ͍ͱ͍͚ͳ͔ͬͨͷͰศརʹͳͬͨ
#cybozu_mobile σϞ
#cybozu_mobile σϞ Source: https://github.com/Kyome22/ShootingStar.git
#cybozu_mobile গ͠ղઆ LineMark Λ༻͍ͨγϯϓϧͳંΕઢάϥϑ .foregroundStyle() Ͱ .linearGradient() Λࢦఆ ͢Δͱάϥσʔγϣϯ͖ͷંΕઢάϥϑ ʹͳͬͯΧοί͍͍
Source: https://github.com/Kyome22/ShootingStar.git
#cybozu_mobile গ͠ղઆ BarMark Λ༻͍ͨάϥϑ BarMark ͷ stacking Λ .center ʹ͢Δͱ
ઢରশͳάϥϑΛඳ͚Δ Source: https://github.com/Kyome22/ShootingStar.git
#cybozu_mobile গ͠ղઆ άϥϑʹݟ͑Δ͔͠Εͳ͍͕ɺ ͜Εࢄਤ Prot ͱ PointMark Λ༻ͯ͠ঢ়ʹํܗ ͷجΛஔ͢Δ ֤ํܗ֯ͱ͞ΛมߋͰ͖ΔΑ͏ʹ
͓ͯ͘͠ தԝͷԁRMSʹ߹Θͤͯ scaleE ff ect Ͱ େ͖͞ΛมԽ͍ͤͯ͞ΔʢάϥϑͰͳ͍ʣ Source: https://github.com/Kyome22/ShootingStar.git
#cybozu_mobile Thank you!