Thanks for the new update.
There is an issue with the sound. After maybe 5-10 minutes into the session the cards do not produce sound anymore. Only had that issue after installing 24.11 update for the desktop version.
When closing and restarting Anki sound is produced again for a while.
1 Like
abdo
December 17, 2024, 8:32am
2
Not aware of any change to sound handling in the last version.
Are you on Windows or macOS? If you go to the Task Manager do you see the âmpvâ process?
1 Like
Thank you for the reply.
I use windows 11 on my laptop and windows 10 on my PC. Both have the same issue since the update. I do see the mpv process. How to move from there?
Btw a friend reported the same issue already before the update. I think he is using a mac.
I have the same issue. The sound doesnât work on ios. I regret paying $40 and now it doesnât work!
@saftbaum
Since youâre on Windows, Iâd try to do one of the following steps.
Update mpv to the latest version.
Use the Task Manager to shut down the mpv.exe process, review a card with sound or click on the audio replay button, Anki will start a new mpv.exe process in a few seconds, and see if it helps or not.
Open Anki, enable mpv logging and look at the log file once the same issue appears again, maybe itâll contain some helpful information.
To do it, run the following code in the debug console to temporarily enable mpv logging (while mpv is still running)
Miscellaneous - Anki Manual
import os
from aqt.sound import mpvManager
path = os.path.expanduser("~/Desktop/mpv.log.txt")
mpvManager.set_property("log-file", path)
print(mpvManager.get_property("log-file"))
Once the issue appears again, open ~/Desktop/mpv.log.txt
in the text editor and look at the last lines.
The last lines should look something like this and the audio filename should match the one from the card, i.e [sound:audio.mp3]
in one of the fields.
[3269.419][d][cplayer] Run command: loadfile, flags=64, args=[url="C:\\Users\\...\\AppData\\Roaming\\Anki2\\User 1\\collection.media\\audio.mp3", flags="replace", options="pause=no"]
...
[3269.463][v][cplayer] starting audio playback
...
[3279.762][v][cplayer] finished playback, success (reason 0)
The complete log will look something like this.
Spoiler
[ 45.653][d][cplayer] Run command: loadfile, flags=64, args=[url="C:\\Users\\N\\AppData\\Roaming\\Anki2\\# Email - Hayk - Dutch\\collection.media\\audio.mp3", flags="replace", options=""]
[ 45.653][v][cplayer] Running hook: ytdl_hook/on_load
[ 45.655][v][ytdl_hook] ytdl:// hook
[ 45.655][v][ytdl_hook] not a ytdl:// url
[ 45.656][v][ifo_dvdnav] Opening C:\Users\N\AppData\Roaming\Anki2\# Email - Hayk - Dutch\collection.media\audio.mp3
[ 45.657][v][bdmv/bluray] Opening C:\Users\N\AppData\Roaming\Anki2\# Email - Hayk - Dutch\collection.media\audio.mp3
[ 45.657][v][file] Opening C:\Users\N\AppData\Roaming\Anki2\# Email - Hayk - Dutch\collection.media\audio.mp3
[ 45.657][d][file] resize stream to 131072 bytes, drop 0 bytes
[ 45.657][d][file] Stream opened successfully.
[ 45.658][v][demux] Trying demuxers for level=normal.
[ 45.658][d][demux] Trying demuxer: disc (force-level: normal)
[ 45.658][d][demux] Trying demuxer: edl (force-level: normal)
[ 45.658][d][demux] Trying demuxer: cue (force-level: normal)
[ 45.658][d][demux] Trying demuxer: rawaudio (force-level: normal)
[ 45.658][d][demux] Trying demuxer: rawvideo (force-level: normal)
[ 45.658][d][demux] Trying demuxer: mkv (force-level: normal)
[ 45.658][d][demux] Trying demuxer: libarchive (force-level: normal)
[ 45.658][d][demux] Trying demuxer: lavf (force-level: normal)
[ 45.668][v][lavf] Found 'mp3' at score=25 size=2048.
[ 45.669][v][lavf] Found 'mp3' at score=51 size=4096.
[ 45.672][d][ffmpeg/demuxer] mp3: Skipping 0 bytes of junk at 253.
[ 45.673][v][lavf] avformat_find_stream_info() finished after 22602 bytes.
[ 45.673][v][demux] Detected file format: mp3 (libavformat)
[ 45.673][v][cplayer] Opening done: C:\Users\N\AppData\Roaming\Anki2\# Email - Hayk - Dutch\collection.media\audio.mp3
[ 45.674][v][cplayer] Running hook: ytdl_hook/on_preloaded
[ 45.674][v][lavf] select track 0
[ 45.674][i][cplayer] (+) Audio --aid=1 (mp3 2ch 44100Hz)
[ 45.676][v][ad] Codec list:
[ 45.676][v][ad] mp3float (mp3) - MP3 (MPEG audio layer 3)
[ 45.676][v][ad] mp3 - MP3 (MPEG audio layer 3)
[ 45.676][v][ad] Opening decoder mp3float
[ 45.676][v][ad] Requesting 1 threads for decoding.
[ 45.676][v][ad] Selected codec: mp3float (MP3 (MPEG audio layer 3))
[ 45.676][v][user_filter_wrapper] Setting option 'graph' = 'apad=pad_dur=0.150' (flags = 0)
[ 45.677][v][af] User filter list:
[ 45.677][v][af] lavfi (lavfi.00)
[ 45.677][v][cplayer] Starting playback...
[ 45.678][v][af] [in] 44100Hz stereo 2ch floatp
[ 45.678][v][af] [lavfi] 44100Hz stereo 2ch floatp
[ 45.678][d][ffmpeg] mpv_src_in0: tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:(null)
[ 45.678][d][lavfi] Filter graph:
[ 45.678][d][lavfi] +---------------+
[ 45.678][d][lavfi] mpv_src_in0:default--[44100Hz fltp:stereo]--default| Parsed_apad_0 |default--[44100Hz fltp:stereo]--mpv_sink_out0:default
[ 45.678][d][lavfi] | (apad) |
[ 45.678][d][lavfi] +---------------+
[ 45.678][d][lavfi]
[ 45.678][d][lavfi] +---------------+
[ 45.678][d][lavfi] Parsed_apad_0:default--[44100Hz fltp:stereo]--default| mpv_sink_out0 |
[ 45.678][d][lavfi] | (abuffersink) |
[ 45.678][d][lavfi] +---------------+
[ 45.678][d][lavfi]
[ 45.678][d][lavfi] +-------------+
[ 45.678][d][lavfi] | mpv_src_in0 |default--[44100Hz fltp:stereo]--Parsed_apad_0:default
[ 45.678][d][lavfi] | (abuffer) |
[ 45.678][d][lavfi] +-------------+
[ 45.678][d][lavfi]
[ 45.678][d][lavfi]
[ 45.678][v][af] [userspeed] 44100Hz stereo 2ch floatp
[ 45.678][v][af] [userspeed] (disabled)
[ 45.678][v][af] [convert] 44100Hz stereo 2ch floatp
[ 45.678][v][ao] Trying audio driver 'wasapi'
[ 45.678][v][ao/wasapi] requested format: 44100 Hz, stereo channels, floatp
[ 45.678][d][ao/wasapi] Init wasapi
[ 45.678][d][ao/wasapi] Find device ''
[ 45.683][v][ao/wasapi] No device specified. Selecting default.
[ 45.687][v][ao/wasapi] Selecting device '{2bb2fedf-ce99-4274-96f5-b3c55565b823}' (Speakers (2- High Definition Audio Device))
[ 45.687][v][ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{2bb2fedf-ce99-4274-96f5-b3c55565b823}
[ 45.691][d][ao/wasapi] Init wasapi thread
[ 45.691][d][ao/wasapi] Activating pAudioClient interface
[ 45.692][d][ao/wasapi] Probing formats
[ 45.693][v][ao/wasapi] Trying stereo float (32/32 bits) @ 48000hz (shared) -> ok
[ 45.693][v][ao/wasapi] Accepted as stereo float @ 48000hz -> stereo float (32/32 bits) @ 48000hz (shared)
[ 45.693][d][ao/wasapi] Fixing format
[ 45.693][d][ao/wasapi] IAudioClient::GetDevicePeriod
[ 45.694][v][ao/wasapi] Device period: 10 ms
[ 45.694][d][ao/wasapi] IAudioClient::Initialize
[ 45.723][d][ao/wasapi] IAudioClient::Initialize pRenderClient
[ 45.723][d][ao/wasapi] IAudioClient::Initialize IAudioClient_SetEventHandle
[ 45.723][d][ao/wasapi] IAudioClient::Initialize IAudioClient_GetBufferSize
[ 45.723][v][ao/wasapi] Buffer frame count: 2400 (50 ms)
[ 45.723][v][ao/wasapi] IAudioClock::GetFrequency gave a frequency of 384000.
[ 45.726][d][ao/wasapi] IAudioClient::Initialize pAudioVolume
[ 45.726][d][ao/wasapi] Entering dispatch loop
[ 45.726][d][ao/wasapi] Init wasapi done
[ 45.726][v][ao/wasapi] device buffer: 2400 samples.
[ 45.726][v][ao/wasapi] using soft-buffer of 9600 samples.
[ 45.726][i][cplayer] AO: [wasapi] 48000Hz stereo 2ch float
[ 45.726][v][cplayer] AO: Description: Windows WASAPI audio output (event mode)
[ 45.726][v][autoconvert] inserting resampler
[ 45.726][v][swresample] format change, reinitializing resampler
[ 45.726][v][swresample] 44100Hz stereo floatp -> 48000Hz stereo float
[ 45.727][v][af] [out] 48000Hz stereo 2ch float
[ 45.728][d][osc] osc_init
[ 45.728][v][cplayer] audio ready
[ 45.728][v][cplayer] starting audio playback
[ 45.728][d][ao/wasapi] Thread Resume
[ 45.728][d][ao/wasapi] Thread Reset
[ 45.728][v][cplayer] playback restart complete @ 0.000000, audio=playing, video=eof
[ 45.729][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="append", value="osc-margins=0.000000,0.000000,0.000000,0.000000"]
[ 45.729][v][cplayer] Set property: shared-script-properties -> 1
[ 45.729][d][cplayer] Run command: enable-section, flags=64, args=[name="showhide", flags="allow-hide-cursor+allow-vo-dragging"]
[ 45.729][d][cplayer] Run command: enable-section, flags=64, args=[name="showhide_wc", flags="allow-hide-cursor+allow-vo-dragging"]
[ 45.750][v][lavf] EOF reached.
[ 46.751][v][af] filter input EOF
[ 46.901][v][af] filter output EOF
[ 46.901][v][cplayer] audio filter EOF
[ 46.901][v][cplayer] audio draining
[ 47.101][d][cplayer] Run command: stop, flags=64, args=[flags=""]
[ 47.101][v][cplayer] EOF code: 4
[ 47.101][d][ad] Uninit decoder.
[ 47.101][d][ao/wasapi] Thread Reset
[ 47.101][d][ao/wasapi] Uninit wasapi
[ 47.102][d][ao/wasapi] Thread Reset
[ 47.102][d][ao/wasapi] Thread shutdown
[ 47.107][d][ao/wasapi] Thread uninit done
[ 47.108][d][ao/wasapi] Thread return
[ 47.109][d][ao/wasapi] Uninit wasapi done
[ 47.109][d][cplayer] Terminating demuxers...
[ 47.110][d][cplayer] Done terminating demuxers.
[ 47.111][v][cplayer] finished playback, success (reason 2)
Install VLC and this add-on. Maybe VLC will behave differently than mpv.
No Sound Fix (VLC)
Try to remove or reinstall your audio driver.
It should be pretty safe thing to do, but take it with a grain of salt.
Open Device Manager (Win + X), expand the âSound, video, and game controllersâ section, right-click on your audio device (e.g., âRealtek High Definition Audioâ or âHigh Definition Audio Deviceâ), click âUninstall deviceâ from the context menu and restart your PC.
Windows will automatically reinstall the default audio driver during the restart if a compatible one is available, or download the latest audio driver from the motherboard manufacturerâs website (Win > System Information > BaseBoard Manufacturer).
@Japachin
It sounds like a different issue. Does it work on PC?
If it doesnât work either, what your card looks like? It should include the audio replay button (âa black triangle in a white circleâ).
If it does work, maybe the audio files were encoded as OGG and iOS doesnât support this format yet. But to be sure, one of the audio files (that donât work on iOS) can be checked with https://mediaarea.net/MediaInfoOnline .
In this case, reencoding the audio files (that donât work on iOS) as MP3 should resolve the issue, for example, by using FFmpeg or VLC (Media > Convert / SaveâŚ) and updating the notes to reference new audio files by opening the card browser and using Notes > âFind and Replaceâ to replace .ogg]
with .mp3]
(if they had an .ogg extension).
For how to locate the audio files, see https://docs.ankiweb.net/media.html
1 Like
Thank you @kelciour for the troubleshooting!
I tried them all. Unfortunately the problem persists.
Didnât make a difference.
Works only for a couple of minutes.
The log file was not created. What to do?
The add-on doesnât work. I get an error message that sound and video will not function unless mpv or mplayer is installed.
Didnât make a difference.
The log file was not created. What to do?
Thatâs strange. What was the output from the debug console? It should look something like this, and the last line will point to the log file that was just created.
Alternatively, create mpv.conf
or download it from https://gist.github.com/kelciour/384a1b02b3349e0a7685d690b8ba55bb that looks like this
log-file=C:\Users\USERNAME\AppData\Roaming\Anki2\mpv.log.txt
and replace USERNAME
with the correct path, then put it in %APPDATA%\Anki2
and restart Anki (if it was open).
https://docs.ankiweb.net/files.html#file-locations
If the path was set to be correct, the âmpv.log.txtâ file will appear in the same folder.
The add-on doesnât work.
Please install https://www.videolan.org/vlc/ at C:\Program Files\VideoLAN\VLC
and try it again.
3 Likes
Thank you, I made some progress.
After finding out that I had to press CTRL+enter to execute the command the log file was created These are the last entries up to the point when the player stopped producing sound
Do you see anything meaningful in there? I couldnât find any labels of the audios in the log file.
Yes, that worked I can use No Sound Fix (VLC) addon now. Yet I stopped using it because the âpause audio buttonâ didnât work anymore. When disabling No Sound Fix it works again. I had reallocated the pause button with the " Customize Keyboard Shortcuts" addon. Maybe thereâs a conflict between those two apps.