Try the following code in the debug console after changing Basic in the first line to the name of the notetype of the cards:
NOTETYPE_NAME = "Basic"
nids = mw.col.find_notes(f'note:"{NOTETYPE_NAME}"')
notes = []
RE = re.compile(r"(.*)(\[sound:.*\])")
for nid in nids:
note = mw.col.get_note(nid)
m = RE.match(note['Front'])
if m:
if m.group(2):
note['Front'] = m.group(2)
if m.group(1):
note['Extra'] = m.group(1)
notes.append(note)
mw.col.update_notes(notes)
Please take a backup of your collection before running the code. See Exporting - Anki Manual
update_notes should work in the latest version. Try the following code instead:
NOTETYPE_NAME = "Basic"
nids = mw.col.find_notes(f'note:"{NOTETYPE_NAME}"')
RE = re.compile(r"(.*)(\[sound:.*\])")
for nid in nids:
note = mw.col.getNote(nid)
m = RE.match(note['Front'])
if m:
if m.group(2):
note['Front'] = m.group(2)
if m.group(1):
note['Extra'] = m.group(1)
mw.col.update_note(note)
Replacing mw.col.update_note(note) with note.flush() should work on your Anki (and I guess is more appropriate here since update_note will add an undo entry for each note, slowing things down).