diff --git a/src/pulse/sample-extended.h b/src/pulse/sample-extended.h
new file mode 100644
index 0000000..3c3b2de
--- /dev/null
+++ b/src/pulse/sample-extended.h
@@ -0,0 +1,114 @@
+#ifndef foosampleextendedhfoo
+#define foosampleextendedhfoo
+
+/***
+  This file is part of PulseAudio.
+
+  Copyright 2004-2006 Lennart Poettering
+  Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
+
+  PulseAudio is free software; you can redistribute it and/or modify
+  it under the terms of the GNU Lesser General Public License as published
+  by the Free Software Foundation; either version 2.1 of the License,
+  or (at your option) any later version.
+
+  PulseAudio is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with PulseAudio; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+  USA.
+***/
+
+#include <inttypes.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <math.h>
+#include <pulse/sample.h>
+#include <pulse/gccmacro.h>
+#include <pulse/cdecl.h>
+#include <pulse/version.h>
+
+PA_C_DECL_BEGIN
+
+/** extended format definitions. We use 1 bit per format or type so
+   that a sink can show it supports multiple formats. The client
+   application should only use one format when creating a stream */
+
+typedef enum pa_extended_type {
+    PA_PCM        = 0,
+    PA_IEC958     = 1,
+    PA_MP3        = 2,
+    PA_AAC        = 4,
+} pa_extended_type_t;
+
+/* subtypes and other enums */
+typedef enum pa_aac_syntax {
+    PA_AAC_ADTS = 0,
+    PA_AAC_ADIF = 1,
+    PA_AAC_RAW  = 2
+} pa_aac_syntax_t;
+
+typedef enum pa_aac_profile {
+    PA_AAC_MAIN = 0,
+    PA_AAC_LC   = 1,
+    PA_AAC_SSR  = 2
+} pa_aac_profile_t;
+
+typedef enum pa_cea_audio_type {
+	PA_CEA_AUDIO_TYPE_REFER_TO_STREAM_HEADER   =  0x0000U,
+	PA_CEA_AUDIO_TYPE_LPCM                     =  0x0001U,
+	PA_CEA_AUDIO_TYPE_AC3                      =  0x0002U,
+	PA_CEA_AUDIO_TYPE_MPEG1                    =  0x0004U,
+	PA_CEA_AUDIO_TYPE_MP3                      =  0x0008U,
+	PA_CEA_AUDIO_TYPE_MPEG2                    =  0x0010U,
+	PA_CEA_AUDIO_TYPE_AACLC                    =  0x0020U,
+	PA_CEA_AUDIO_TYPE_DTS                      =  0x0040U,
+	PA_CEA_AUDIO_TYPE_ATRAC                    =  0x0080U,
+	PA_CEA_AUDIO_TYPE_SACD                     =  0x0100U,
+	PA_CEA_AUDIO_TYPE_EAC3                     =  0x0200U,
+	PA_CEA_AUDIO_TYPE_DTS_HD                   =  0x0400U,
+	PA_CEA_AUDIO_TYPE_MLP                      =  0x0800U,
+	PA_CEA_AUDIO_TYPE_DST                      =  0x1000U,
+	PA_CEA_AUDIO_TYPE_WMAPRO                   =  0x2000U,
+	PA_CEA_AUDIO_TYPE_HE_AAC                   =  0x4000U,
+	PA_CEA_AUDIO_TYPE_HE_AAC2                  =  0x8000U,
+	PA_CEA_AUDIO_TYPE_MPEG_SURROUND            =  0x10000U
+} pa_cea_audio_type_t;
+
+typedef struct pa_mp3_params {
+    uint32_t disable_crc;
+} pa_mp3_params_t;
+
+typedef struct pa_aac_params {
+    uint32_t disable_crc;
+    pa_aac_syntax_t syntax;
+    pa_aac_profile_t profile;
+} pa_aac_params_t;
+
+/** extended format and attribute specification */
+typedef struct pa_sample_spec_extended {
+    pa_extended_type_t extended_type;
+
+    uint32_t rate;
+    /**< The sample rate. (e.g. 44100) */
+
+    uint8_t channels;
+    /**< Audio channels. (1 for mono, 2 for stereo, ...) */
+
+    union {
+        pa_sample_spec      pcm_sample_spec; /*< rate and channels are duplicated here*/
+        pa_cea_audio_type_t cea_audio_type;
+        pa_mp3_params_t     mp3_params;
+        pa_aac_params_t     aac_params;
+        uint32_t            rfa[16]; /* define max size */
+    };
+    /** subtypes and parameters */
+} pa_sample_spec_extended;
+
+PA_C_DECL_END
+
+#endif
diff --git a/src/pulse/sample.h b/src/pulse/sample.h
index 7a4a55a..3b9dc17 100644
--- a/src/pulse/sample.h
+++ b/src/pulse/sample.h
@@ -164,6 +164,10 @@ typedef enum pa_sample_format {
     PA_SAMPLE_S24_32BE,
     /**< Signed 24 Bit PCM in LSB of 32 Bit words, big endian. \since 0.9.15 */
 
+    PA_SAMPLE_EXTENDED,
+    /**< This is an escape code to signal the extended representation
+       should be used. Required to extended native protocol. \since 0.9.22 */
+
     PA_SAMPLE_MAX,
     /**< Upper limit of valid sample types */
 
diff --git a/src/pulse/stream.h b/src/pulse/stream.h
index b905788..05be824 100644
--- a/src/pulse/stream.h
+++ b/src/pulse/stream.h
@@ -26,6 +26,7 @@
 #include <sys/types.h>
 
 #include <pulse/sample.h>
+#include <pulse/sample-extended.h>
 #include <pulse/channelmap.h>
 #include <pulse/volume.h>
 #include <pulse/def.h>
@@ -353,6 +354,26 @@ pa_stream* pa_stream_new_with_proplist(
         const pa_channel_map *map         /**< The desired channel map, or NULL for default */,
         pa_proplist *p                    /**< The initial property list */);
 
+/** Create a new, unconnected stream with the specified name and
+ * extended sample type, ie not necessarily PCM. It is recommended to
+ * use pa_stream_extended_new_with_proplist() instead and specify some
+ * initial properties. */
+pa_stream* pa_stream_extended_new(
+        pa_context *c                     /**< The context to create this stream in */,
+        const char *name                  /**< A name for this stream */,
+        const pa_sample_spec_extended *ss /**< The desired sample format, not limited to PCM */,
+        const pa_channel_map *map         /**< The desired channel map, or NULL for default */);
+
+/** Create a new, unconnected stream with the specified name and
+ * extended sample type, ie not necessarily PCM, and specify the the
+ * initial stream property list. \since 0.9.22 */
+pa_stream* pa_stream_extended_new_with_proplist(
+        pa_context *c                     /**< The context to create this stream in */,
+        const char *name                  /**< A name for this stream */,
+        const pa_sample_spec_extended *ss /**< The desired sample format, not limited to PCM */,
+        const pa_channel_map *map         /**< The desired channel map, or NULL for default */,
+        pa_proplist *p                    /**< The initial property list */);
+
 /** Decrease the reference counter by one */
 void pa_stream_unref(pa_stream *s);
 
