ཐིག་ཁ་མང་བའི་སྒྲ་རྩོམ་སྒྲིག་ཆས།། JavaScript དཔེ་མཛོད།
སྒྲ་ཐིག་མང་པོའི་སྒྲ་རྩོམ་སྒྲིག་ཆས་ཀྱི་འཕྲུལ་འཁོར། གསང་འགྲོལ། ཀྲག་སྒྲ་མེད་པར་གཅོད་སྦྲེལ། སྒྲ་ཡལ་དང་སྒྲ་ཚད། ཐད་གཏོང་། སྲེ་སྦྱོར་དང་ WAV ཡང་ན་ MP3 ལ་ཕྱིར་འདྲེན། དྲ་བཤར་ཆས་ཀྱི་ཉར་ཚགས་སུ་ལས་གཞི།
@openlibsdev/audio-editor- v1.0.0
- ES module
- MIT
སྒྲིག་འཇུག
ཐུམ་སྒྲིལ་ཆས་སམ་ Node ལུགས་ཀྱི་ནང་འདྲེན་བརྒྱུད།
npm install @openlibsdev/audio-editorimport AudioEditor from "@openlibsdev/audio-editor";ཡང་ན་ཤོག་ངོས་ནང་ཐད་ཀར་བཟོ་སྐྲུན་མེད་པར། (jsDelivr ཀྱིས་བརྟེན་གནས་ཐག་གཅོད་བྱེད།)
<script type="module">
import AudioEditor from "https://cdn.jsdelivr.net/npm/@openlibsdev/audio-editor@1.0.0/+esm";
</script>བེད་སྤྱོད།
import AudioEditor from "@openlibsdev/audio-editor";
const file = document.querySelector("input[type=file]").files[0];
const buffer = await AudioEditor.decodeAudio(await file.arrayBuffer());
const part = AudioEditor.sliceAudioBuffer(buffer, 0, Math.min(2, buffer.duration));
const wav = AudioEditor.audioBufferToWav(part); // a Blob
const mp3 = await AudioEditor.encodeToFormat(part, "mp3", 192);API
AudioEditor.decodeAudio(arrayBuffer)
སྒྲའི་ཡིག་ཆ་ (ArrayBuffer) AudioBuffer ལ་གསང་འགྲོལ་བྱེད།
AudioEditor.sliceAudioBuffer(buffer, startSec, endSec)
start ནས་ end བར་ (སྐར་ཆ།) གྱི་དུམ་བུ་ AudioBuffer གསར་པར་གཅོད། མཐའ་ལ་ཀྲག་སྒྲ་འགོག་ཆེད་སྒྲ་ཡལ་ཐུང་ངུ་འཇུག
AudioEditor.spliceOutRange(buffer, startSec, endSec)
དུམ་བུ་ཞིག་སུབ་ནས་ལྷག་མ་སྦྲེལ།
AudioEditor.computePeak(buffer)
མཐོ་ཤོས་ཀྱི་དཔེ་ཚད་ཚད་གཞི། 0–1།
AudioEditor.audioBufferToWav(buffer)
AudioBuffer དེ་ WAV Blob ལ་ཨང་སྒྲིག་བྱེད།
AudioEditor.audioBufferToMp3(buffer, kbps)
AudioBuffer དེ་གཏན་འཁེལ་གྱི་ bitrate ཐོག་ MP3 Blob ལ་ཨང་སྒྲིག་བྱེད།
AudioEditor.encodeToFormat(audioBuffer, format, bitrate)
"wav" ཡང་ན་ "mp3" ལ་ཨང་སྒྲིག་བྱེད།
AudioEditor.renderMixdown(tracks, opts)
སྒྲ་ཐིག་རྣམས་གནས་ས་དང་ཕྱོགས་སྒྲ། སྒྲ་ཚད། སྒྲ་ཡལ། ཁ་རོག་དང་རྐྱང་པ་བཅས་མཉམ་དུ་ AudioBuffer གཅིག་ཏུ་སྲེ།
AudioEditor.renderSingleTrack(track, opts)
སྒྲ་ཐིག་གཅིག་དེའི་སྒྲ་ཚད་དང་སྒྲ་ཡལ་བཅས་ཐོག་བཟོ།
AudioEditor.startAudio()
སྒྲའི་ཁོར་ཡུག་འགོ་འཛུགས། སྤྱོད་མཁན་གྱི་བྱ་བ་ (གནོན་པ།) ནས་འབོད།
AudioEditor.startLive(track, opts)
སྒྲ་ཐིག་ཐད་གཏོང་བྱེད།
AudioEditor.stopLive(live)
ཐད་གཏོང་མཚམས་འཇོག
AudioEditor.saveProjectToDb(project)
ལས་གཞི་དྲ་བཤར་ཆས་ཀྱི་ཉར་ཚགས་ (IndexedDB) སུ་ཉར།
AudioEditor.loadProjectFromDb(id)
ཉར་ཟིན་པའི་ལས་གཞི་དེའི་ id ཐོག་འཇུག
AudioEditor.now()
སྒྲའི་ཆུ་ཚོད་ཀྱི་ད་ལྟའི་དུས་ཚོད་སྐར་ཆའི་ཐོག (startLive དང scheduleTrackFades ཀྱི་དུས་ཚོད་གཞི་རྩ།)
AudioEditor.scheduleTrackFades(gainParam, track, startAtCtxTime, segmentStartOffsetInTrack, segmentDuration, audible, masterVolume)
སྒྲ་ཤུལ་གྱི་སྒྲ་ཤུགས་ gain ཚད་གཞིའི་སྟེང་དུ་འཆར་འགོད་བྱེད། རིམ་གྱིས་འཆར་བ། རིམ་གྱིས་ཡལ་བ། སྒྲ་ཤུལ་དང་སྤྱིའི་སྒྲ་ཤུགས། ཡང་ན་སྒྲ་ཤུལ་སྒྲ་མེད་བཟོས་ཚེ་ཁ་རོག
AudioEditor.APP
མཛོད་ཁང་གི་མིང་དང་པར་གཞི། {name, version}
བརྟེན་གནས།
དཔེ་མཛོད་ཀྱིས་འཇུག་པ་དང་དེའི་ཆོག་མཆན། (ཚང་མ་ཆོག་མཆན་ཤོག་ངོས་སུ་ཡོད།)
| མིང་། | པར་གཞི། | ཆོག་མཆན། | ཡིག་ཆ། |
|---|---|---|---|
| @breezystack/lamejs | 1.2.7 | LGPL-3.0 | ཆོག་མཆན། · འབྱུང་ཁུངས་ཨང་རྟགས། |
| tone | 15 | MIT | ཆོག་མཆན། · འབྱུང་ཁུངས་ཨང་རྟགས། |
| wavesurfer.js | 7 | BSD-3-Clause | ཆོག་མཆན། · འབྱུང་ཁུངས་ཨང་རྟགས། |
| wavesurfer.js | 7 | BSD-3-Clause | ཆོག་མཆན། · འབྱུང་ཁུངས་ཨང་རྟགས། |
| wavesurfer.js | 7 | BSD-3-Clause | ཆོག་མཆན། · འབྱུང་ཁུངས་ཨང་རྟགས། |