PowerShell / PSReadLine

A bash inspired readline implementation for PowerShell
BSD 2-Clause "Simplified" License
3.71k stars 295 forks source link

audio #4165

Closed prosCcoding closed 3 weeks ago

prosCcoding commented 3 weeks ago

Prerequisites

Exception report

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
Last 150 Keys:
 Space & Space ' c : \ U s e r s \ A c e r \ A p p D a t a \ L o c a l \ P r o g r a m s \ P y t h o n \ P y t h o n 3 1 2 \ p y t h o n . e x e ' Space ' c : \ U s e r s \ A c e r \ . v s c o d e \ e x t e n s i o n s \ m s - p y t h o n . d e b u g p y - 2 0 2 4 . 1 0 . 0 - w i n 3 2 - x 6 4 \ b u n d l e d \

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: left
Actual value was -2.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------

Screenshot

n/a

Environment data

PS Version: 5.1.19041.4780
PS HostName: ConsoleHost
PSReadLine Version: 2.0.0-beta2
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 118
BufferHeight: 25

Steps to reproduce

import speech_recognition as sr

recognizer = sr.Recognizer() with sr.Microphone() as source: print("Please say something...") audio = recognizer.listen(source) try: command = recognizer.recognize_google(audio) print(f"You said: {command}") except sr.UnknownValueError: print("Sorry, I could not understand the audio.") except sr.RequestError as e: print(f"Could not request results from Google Speech Recognition service; {e}")

Expected behavior

to say something

Actual behavior

gives me the long exception

github-actions[bot] commented 3 weeks ago

This issue was already fixed (see #1306). Please upgrade to the 2.3.5 version of PSReadLine from PowerShell Gallery. See the upgrading section for instructions. Please let us know if you run into the same issue with the latest version.