> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # 음성.닫기() 그만큼`close()`메서드는 실시간 음성 서비스 연결을 끊고 리소스를 정리합니다. 이는 음성 세션을 적절하게 종료하고 리소스 누출을 방지하는 데 중요합니다. ## 사용예 ```typescript import { OpenAIRealtimeVoice } from '@mastra/voice-openai-realtime' import { getMicrophoneStream } from '@mastra/node-audio' // Initialize a real-time voice provider const voice = new OpenAIRealtimeVoice({ realtimeConfig: { model: 'gpt-5.1-realtime', apiKey: process.env.OPENAI_API_KEY, }, }) // Connect to the real-time service await voice.connect() // Start a conversation voice.speak("Hello, I'm your AI assistant!") // Stream audio from a microphone const microphoneStream = getMicrophoneStream() voice.send(microphoneStream) // When the conversation is complete setTimeout(() => { // Close the connection and clean up resources voice.close() console.log('Voice session ended') }, 60000) // End after 1 minute ``` ## 매개변수 이 메서드는 매개변수를 허용하지 않습니다. ## 반환 값 이 메서드는 값을 반환하지 않습니다. ## 메모 - 실시간 음성 세션 사용을 마치면 리소스를 해제하기 위해 항상 `close()`를 호출하세요. - `close()`를 호출한 후 새 세션을 시작하려면 `connect()`를 다시 호출해야 합니다. - 이 메서드는 주로 지속적인 연결을 유지하는 실시간 음성 Provider에 사용됩니다. - 실시간 연결을 지원하지 않는 음성 Provider에서 호출하면 경고를 기록하고 아무 작업도 수행하지 않습니다. - 연결을 닫지 않으면 리소스 누수가 발생하고 음성 서비스 Provider의 요금 청구 문제가 생길 수 있습니다.