unpacked audio loop but its got noise
This commit is contained in:
parent
48a91b96ef
commit
1edff506c1
2 changed files with 7 additions and 5 deletions
|
@ -188,11 +188,11 @@ wait_loop:
|
||||||
sta sample_ptrh
|
sta sample_ptrh
|
||||||
|
|
||||||
cmp #.hibyte(audio_samples_end)
|
cmp #.hibyte(audio_samples_end)
|
||||||
bne audio_cont
|
bmi audio_cont
|
||||||
|
|
||||||
;lda sample_ptrl
|
lda sample_ptrl
|
||||||
;cmp #.lobyte(audio_samples_end)
|
cmp #.lobyte(audio_samples_end)
|
||||||
;bne audio_cont
|
bmi audio_cont
|
||||||
|
|
||||||
lda #.lobyte(audio_samples)
|
lda #.lobyte(audio_samples)
|
||||||
sta sample_ptrl
|
sta sample_ptrl
|
||||||
|
|
|
@ -50,6 +50,7 @@ function audio2assembly(audio) {
|
||||||
audio_samples:
|
audio_samples:
|
||||||
${byte2byte(pack(audio))}
|
${byte2byte(pack(audio))}
|
||||||
audio_samples_end:
|
audio_samples_end:
|
||||||
|
.byte 24
|
||||||
|
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +58,8 @@ audio_samples_end:
|
||||||
function wav2assembly(buffer) {
|
function wav2assembly(buffer) {
|
||||||
let wav = new WaveFile(buffer);
|
let wav = new WaveFile(buffer);
|
||||||
let samples = wav.getSamples();
|
let samples = wav.getSamples();
|
||||||
return audio2assembly(samples);
|
let n = samples.length - (samples.length % 131);
|
||||||
|
return audio2assembly(samples.slice(0, n));
|
||||||
}
|
}
|
||||||
|
|
||||||
let infile = process.argv[2];
|
let infile = process.argv[2];
|
||||||
|
|
Loading…
Reference in a new issue