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
110
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
720
ブラウザアプリを自作してわかったWebViewの扱い方/iOS Meetup in 福岡
kyome22
1
3.3k
iOSのウィジェットでも猫走らせたい / iOSDC Japan 2022 Day2 Unconference
kyome22
3
1.1k
Hacking Xcode Behaviors / macOS native symposium #08
kyome22
2
1.6k
AppKitでお絵描きをしてみよう / macOS native symposium #06
kyome22
2
690
Finder Sync Extension で Mac 向け便利ツールを作ろう / iOSDC Japan 2021
kyome22
6
4.4k
iOS Custom Keyboardsでできること/できないこと/やってはいけないこと / iOSDC Japan 2020 LT
kyome22
3
1.9k
Other Decks in Programming
See All in Programming
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
200
CSC509 Lecture 11
javiergs
PRO
0
180
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
Outline View in SwiftUI
1024jp
1
330
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
Jakarta EE meets AI
ivargrimstad
0
140
Click-free releases & the making of a CLI app
oheyadam
2
110
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
4
640
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
役立つログに取り組もう
irof
28
9.6k
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Scaling GitHub
holman
458
140k
4 Signs Your Business is Dying
shpigford
180
21k
Building an army of robots
kneath
302
43k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
The Invisible Side of Design
smashingmag
298
50k
Docker and Python
trallard
40
3.1k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
The Language of Interfaces
destraynor
154
24k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
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!