## Class template basic_vorbis_file_sink

hamigaki::audio::basic_vorbis_file_sink —

Ogg Vorbisファイルへの書き込み専用アクセスを提供するSourceモデル

## Synopsis

    template<typename Sink>
    class basic_vorbis_file_sink {
    public:
      // types
      typedef float                  char_type;
      typedef implementation defined category;

      // construct/copy/destruct
      basic_vorbis_file_sink(const Sink&, long, long, float = 0.1f);
      basic_vorbis_file_sink(const Sink&, long, long, const vorbis_encode_params&);

      // Boost.Iostreams implementation
      std::streamsize optimal_buffer_size() const;
      std::streamsize write(const float*, std::streamsize);
      void close();

      // queries
      long channels() const;
      long rate() const;
    };

    // creation
    template<typename Sink>
      basic_vorbis_file_sink<Sink>
      make_vorbis_file_sink(const Sink&, long, long, float = 0.1f);
    template<typename Sink>
      basic_vorbis_file_sink<Sink>
      make_vorbis_file_sink(const Sink&, long, long, const vorbis_encode_params&);

## Description

受け取ったSinkへPCMデータをOgg Vorbisエンコードして書き出すことができる。

モデルとなるコンセプト:Sink, ClosableDevice, OptimallyBuffered

### `basic_vorbis_file_sink` construct/copy/destruct

1.     basic_vorbis_file_sink(const Sink& sink, long channels, long rate,
                              float quality = 0.1f);

2.     basic_vorbis_file_sink(const Sink& sink, long channels, long rate,
                              const vorbis_encode_params& params);

### `basic_vorbis_file_sink` Boost.Iostreams implementation

1.     std::streamsize optimal_buffer_size() const;

   Returns: | 200ミリ秒分のバッファサイズ

2.     std::streamsize write(const float* s, std::streamsize n);

3.     void close();

### `basic_vorbis_file_sink` queries

1.     long channels() const;

   Returns: | チャンネル数。

2.     long rate() const;

   Returns: | サンプリング周波数。

### `basic_vorbis_file_sink` creation

1.     template<typename Sink>
         basic_vorbis_file_sink<Sink>
         make_vorbis_file_sink(const Sink& sink, long channels, long rate,
                               float quality = 0.1f);

   Returns: | `basic_vorbis_file_sink<Sink>(sink, channels, rate, quality)`

2.     template<typename Sink>
         basic_vorbis_file_sink<Sink>
         make_vorbis_file_sink(const Sink& sink, long channels, long rate,
                               const vorbis_encode_params& params);

   Returns: | `basic_vorbis_file_sink<Sink>(sink, channels, rate, params)`

| 製作著作 © 2006, 2007 Takeshi Mouri