Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
WebAudioと音の話
Search
kalibora
July 28, 2015
Programming
460
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WebAudioと音の話
WebAudioの初歩の初歩
kalibora
July 28, 2015
More Decks by kalibora
See All by kalibora
QA環境で誰でも自由自在に現在時刻を操って検証できるようにした話
kalibora
0
570
PHPのアノテーション(アトリビュート)からOpenAPIのドキュメントを出力し、レスポンスもそれを元にシリアライズすることで仕様と実装を乖離させず、色々楽できたよって話
kalibora
0
270
Swagger (OpenAPI) と PHPStan で REST API でも型安全っぽく使う
kalibora
0
3.6k
Symfony2 の Functional Test のメモリ使用量と実行時間を削減した話
kalibora
0
26
Other Decks in Programming
See All in Programming
SREの越境 / SRE Collaboration
y0hgi
2
280
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
360
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
3.2k
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
680
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.5k
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
8.6k
Are APIs Still Relevant in the AI Era?
soyuka
0
310
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
410
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
18
17k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
550
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.4k
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
170
Featured
See All Featured
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
470
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
340
YesSQL, Process and Tooling at Scale
rocio
174
15k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
510
My Coaching Mixtape
mlcsv
0
320
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
The SEO Collaboration Effect
kristinabergwall1
1
570
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Navigating Weather and Climate Data
rabernat
0
530
Transcript
8FC"VEJPͱԻͷ
8FC"VEJPͬͯ ͬͯ·͔͢ʁ
8FC"VEJPͱʁ w 8FC"VEJP"1*8$ʹΑͬͯ։ൃ͞Ε͍ͯ ΔɺΣϒΞϓϦέʔγϣϯ༻ͷԻॲཧͱԻ ߹ͷͨΊͷߴϨϕϧ+BWB4DSJQU"1* w ओཁͳઃܭύϥμΠϜɺ"VEJP/PEFΦϒδΣ ΫτΛͭͳ͗ɺԻϧʔτάϥϑΛ࡞Δܗɻ࣮ ࡍͷॲཧɺओʹΣϒϒϥβͷ࣮Ͱߦ ΘΕΔ͕ɺ+BWB4DSJQUͰॲཧͯ͠߹͢Δ
͜ͱՄೳ
None
+BWB4DSJQUͰʂ ϒϥβ্Ͱʂ Ի͕ग़ͤΔʂ
Ͱ୯७ʹ XBWͱ͔NQͱ͔Λ ࠶ੜ͢ΔΘ͚͡Όͳ͍Α
ԻΛ߹ͨ͠Γͯ͠ ͲΜͳԻͰग़ͤΔΑ ʢཧ্ʣ
·ͣԻΛग़ͯ͠ΈΑ͏ var ctx = new AudioContext(); var osc =
ctx.createOscillator(); osc.connect(ctx.destination); osc.start(0); osc.stop(ctx.currentTime + 0.5); IUUQTHJTUHJUIVCDPNLBMJCPSBDGCEBFCB
Ͳ͏Ͱ͔͢ʁʂ Ի͕Ͱ·͔ͨ͠ʁ
DUY"VEJP$POUFYU ίʔυΛղઆ PTD var ctx = new AudioContext(); var
osc = ctx.createOscillator(); osc.connect(ctx.destination); osc.start(0); osc.stop(ctx.currentTime + 0.5); EFTUJOBUJPO DPOOFDU TUBSU TUPQ ԻΛग़͢ ஔ εϐʔΧʔ ͷΑ͏ͳ ͷ
ͱ͜ΖͰɺԻۭͬͯؾ தΛΘΔͰ͢ΑͶʁ
͖ͬ͞ग़ͨ͠Իͬͯ ͲΜͳͷܗʢܗʣ Λ͍ͯ͠Δͱࢥ͍·͔͢ʁ
͜ΜͳܗΛ͍ͯ͠·͢
͜ͷܗΛ ਖ਼ݭʢTJOFʣ ͱݴ͍·͢
දతͳܗҰཡ TRVBSFʢۣܗʣ TJOFʢਖ਼ݭʣ USJBOHMFʢࡾ֯ʣ TBXUPPUIʢڒࣃঢ়ʣ
ͲΕ໊લ௨ΓͷܗΛ ͍ͯ͠·͢
࣮ࡍʹͦΕͧΕͷ ܗΛ໐Βͯ͠ΈΑ͏
var ctx = new AudioContext(); var osc = ctx.createOscillator();
var types = ['sine', 'square', 'triangle', 'sawtooth']; var typeIdx = 0; var timerId = setInterval(function () { if (typeIdx >= types.length) { clearInterval(timerId); return; } console.log(types[typeIdx]); osc.type = types[typeIdx]; // set waveform here if (typeIdx === 0) { osc.start(0); osc.stop(ctx.currentTime + types.length * 1); } typeIdx++; }, 1000); osc.connect(ctx.destination); IUUQTHJTUHJUIVCDPNLBMJCPSBCGCDBBEGBBG
ؙ͍ܗؙ͍Ի ΪβΪβͷܗΪβΪβͨ͠Ի ʹฉ͑͜·ͤΜ͔ʁ
ͱ͍͏Θ͚Ͱɺ
Ի৭ͷܗʢܗʣ Ͱܾ·Γ·͢
ͱ͜ΖͰɺ
Իͱ͍͏ͷͷཁૉ Ի৭͚ͩͰ͋Γ·ͤΜ
Իͷཁૉ w Ի৭ʢUJNCSF UPOFʣ w େ͖͞ʢMPVEOFTTʣ w ߴ͞ʢQJUDIʣ
Ͱେ͖͞ͱߴ͞Կ Ͱܾ·ΔͷͰ͠ΐ͏͔ʁ
ج४ͱͳΔԻ
େ͖͍Ի ৼ෯
ߴ͍Ի प
Ͱɺ पΛมߋͯ͠ Իͷߴ͞Λมߋͯ͠Έ·͢
var ctx = new AudioContext(); var osc = ctx.createOscillator();
var freqs = [261.63, 293.67, 329.63, 349.23, 392.00, 440.00, 493.88, 523.23]; var freqIdx = 0; var timerId = setInterval(function () { if (freqIdx >= freqs.length) { clearInterval(timerId); return; } console.log(freqs[freqIdx]); osc.frequency.value = freqs[freqIdx]; // set frequency if (freqIdx === 0) { osc.start(0); osc.stop(ctx.currentTime + freqs.length * 1); } freqIdx++; }, 1000); osc.connect(ctx.destination); IUUQTHJTUHJUIVCDPNLBMJCPSBDEGC
࣍ʹɺ ৼ෯Λίϯτϩʔϧͯ͠ɺ Իͷେ͖͞Λมߋͯ͠Έ·͢
var ctx = new AudioContext(); var osc = ctx.createOscillator();
var gain = ctx.createGain(); var levels = [1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1]; var levelIdx = 0; var timerId = setInterval(function () { if (levelIdx >= levels.length) { clearInterval(timerId); return; } console.log(levels[levelIdx]); gain.gain.value = levels[levelIdx]; // set gain if (levelIdx === 0) { osc.start(0); osc.stop(ctx.currentTime + levels.length * 0.5); } levelIdx++; }, 500); osc.connect(gain); gain.connect(ctx.destination); IUUQTHJTUHJUIVCDPNLBMJCPSBGCFGGBCB
DUY"VEJP$POUFYU ίʔυΛղઆ PTD var ctx = new AudioContext(); var
osc = ctx.createOscillator(); var gain = ctx.createGain(); (snip) gain.gain.value = levels[levelIdx]; // set gain (snip) osc.connect(gain); gain.connect(ctx.destination); EFTUJOBUJPO DPOOFDU HBJO DPOOFDU ϘϦϡʔϜ ϑΣʔμʔΈ ͍ͨͳͷ
DUY"VEJP$POUFYU ιʔεϊʔυ " σεςΟωʔ γϣϯϊʔυ ϊʔυ " ϊʔυ # ιʔεϊʔυ
# ϊʔυ $ ੨͍࢛֯ϊʔυͱ ݺΕΔͷͰ ͦΕΒΛෳΈ߹Θͤͯ ͍ΖΜͳԻ͕࡞ΕΔΈ͍ͨͰ͢
͓͠·͍
TJOFΛ߹͍ͯ͠Ζ Μͳܗ͕࡞ΕΔ https://www.google.co.jp/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=sin(x) %2Bsin(2x)*(1%2F2)%2Bsin(3x)*(1%2F3)%2Bsin(4x)*(1%2F4)%2Bsin(5x)*(1%2F5)%2Bsin(6x)*(1%2F6)%2Bsin(7x)*(1%2F7) https://www.google.co.jp/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=sin(x) %2Bsin(3x)*(1%2F3)%2Bsin(5x)*(1%2F5)%2Bsin(7x)*(1%2F7)%2Bsin(9x)*(1%2F9)%2Bsin(11x)*(1%2F11)