<commit_before>package main

import (
	//"code.google.com/p/portaudio-go/portaudio"
	"fmt"
	"github.com/Hell0wor1d/go2ffmpeg/ffmpeg"
	"log"
	"os"
)

func init() {
	fmt.Printf("init app.")
}

func main() {
	if len(os.Args) <= 1 {
		fmt.Println("Usage:\n \t./ffmpeg audio_file")
		os.Exit(0)
	}
	inputfile := os.Args[1]
	//	chk := func(err error) {
	//		if err != nil {
	//			panic(err)
	//		}
	//	}
	//	framePerBuffer := 2048
	args := []string{
		"-i", inputfile,
		"-f", "s16le",
		"-",
	}
	ff := ffmpeg.NewFFmpeg(args)
	if ff == nil {
		log.Fatal("ffmpeg can not be nill.")
	}
	//defer ff.Close()
	buffer := make([]byte, 1024)

	ff.Read(buffer)
	//	portaudio.Initialize()
	//	defer portaudio.Terminate()
	//	stream, err := portaudio.OpenDefaultStream(0, 2, 44100, framePerBuffer, ff)
	//chk(err)
	//defer stream.Close()
	//chk(stream.Start())
	//if err := ff.Wait(); err != nil {
	//		log.Fatal(err)
	//	}
	//	chk(stream.Stop())
}<commit_msg>write media stream to a file<commit_after>package main

import (
	//"code.google.com/p/portaudio-go/portaudio"
	"fmt"
	"github.com/Hell0wor1d/go2ffmpeg/ffmpeg"
	"log"
	"os"
)

func init() {
	fmt.Printf("init app.")
}

func main() {
	if len(os.Args) <= 1 {
		fmt.Println("Usage:\n \t./ffmpeg audio_file")
		os.Exit(0)
	}
	inputfile := os.Args[1]
	//	chk := func(err error) {
	//		if err != nil {
	//			panic(err)
	//		}
	//	}
	//	framePerBuffer := 2048
	args := []string{
		"-i", inputfile,
		"-f", "mp3",
		"-",
	}
	ff := ffmpeg.NewFFmpeg(args)
	if ff == nil {
		log.Fatal("ffmpeg can not be nill.")
	}
	//defer ff.Close()
	//buffer := make([]byte, 1024)
	out, err := os.Create("/Users/kevin/filename.mp3")
	defer out.Close()
	if err != nil {
		log.Fatal(err)
	}
	ff.Read(out)
	//	portaudio.Initialize()
	//	defer portaudio.Terminate()
	//	stream, err := portaudio.OpenDefaultStream(0, 2, 44100, framePerBuffer, ff)
	//chk(err)
	//defer stream.Close()
	//chk(stream.Start())
	//if err := ff.Wait(); err != nil {
	//		log.Fatal(err)
	//	}
	//	chk(stream.Stop())
}
{'fraction_non_alphanumeric': 0.2194513715710723, 'fraction_numerical': 0.022942643391521196, 'mean_word_length': 2.8800773694390718, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2699488', 'n_tokens_mistral': 945, 'n_tokens_neox': 891, 'n_words': 164}