View chatgpt-cpp-audio2.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <alsa/asoundlib.h> | |
#include <iostream> | |
int main() { | |
// Open the default PCM device | |
snd_pcm_t *handle; | |
int error = snd_pcm_open(&handle, "default", SND_PCM_STREAM_CAPTURE, 0); | |
if (error < 0) { | |
std::cerr << "Error opening PCM device: " << snd_strerror(error) << std::endl; | |
return 1; |
View chatgpt-cpp-audio1.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <alsa/asoundlib.h> | |
#include <iostream> | |
int main() { | |
// Open the default PCM device | |
snd_pcm_t *handle; | |
int error = snd_pcm_open(&handle, "default", SND_PCM_STREAM_CAPTURE, 0); | |
if (error < 0) { | |
std::cerr << "Error opening PCM device: " << snd_strerror(error) << std::endl; | |
return 1; |
View chatgpt-linux-read-audio.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <alsa/asoundlib.h> | |
#include <flac++/encoder.h> | |
#include <cstdio> | |
#include <cstring> | |
constexpr int kSampleRate = 44100; // Sample rate in Hz | |
constexpr int kNumChannels = 2; // Number of channels | |
constexpr int kBufferSize = 4096; // Size of the audio buffer |
View chatgpt-audio-stream.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"io" | |
"time" | |
"google.golang.org/grpc" | |
"google.golang.org/grpc/codes" |
View chatgpt-flutter-address-form.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:path/path.dart'; | |
import 'package:sqflite/sqflite.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
View grpc-brain-1_19.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var opts []grpc.DialOption | |
serverAddr := "localhost:50051" | |
conn, err := grpc.Dial(*serverAddr, opts...) | |
if err != nil { | |
log.Fatalf("fail to dial: %v", err) | |
} | |
defer conn.Close() | |
client := pb.NewTheSocialRobotClient(conn) |
View grpc-brain-1_18.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type TheSocialRobotClient interface { | |
EventStream(ctx context.Context, opts ...grpc.CallOption) (TheSocialRobot_EventStreamClient, error) | |
} |
View grpc-brain-1_17.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grpcServer.Serve(lis) |
View grpc-brain-1_16.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pb.RegisterTheSocialRobotServer(grpcServer, new(theSocialRobotServer)) |
View grpc-brain-1_15.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var opts []grpc.ServerOption | |
grpcServer := grpc.NewServer(opts...) |
NewerOlder