NB! It seems this console command is not compatible with CS2.
Command Profile

VOICE_INPUTFROMFILE

CS:GO

This command, if set to 1, will make voice input come from the voice_input.wav file, instead of your microphone.

Syntax
voice_inputfromfile [0 / 1]

Description

This command, if set to 1, will make voice input come from the voice_input.wav file, instead of your microphone.

How To Use voice_inputfromfile

  1. Enable the developer console in Counter-Strike settings.
  2. Open the console with the tilde key (~).
  3. Enter voice_inputfromfile [0 / 1], replacing bracketed arguments with the value you want, then press Enter.

This legacy command is not currently listed as compatible with Counter-Strike 2.

Syntax And Arguments

voice_inputfromfile [0 / 1]
0 / 1 Set to 0 to not use voice input from file (default). Set to 1 to use voice input from file.